<!DOCTYPE html>
<html lang="en-US">
    <head>
        <title>List::MoreUtils - Provide the stuff missing in List::Util - metacpan.org</title>
        <link rel="preload" as="fetch" href="https://metacpan.org/account/login_status" crossorigin="anonymous" />
        <link href="https://metacpan.org/_assets/b8ccceeed47a0652049703d99326a9cea4933443.css" rel="stylesheet" type="text/css">
        <script src="https://metacpan.org/_assets/6bfedafe2d7caa915b7d84f61b45936818e3242e.js" type="text/javascript" defer></script>
        <link rel="alternate" type="application/rss+xml" title="Recent CPAN Uploads of List-MoreUtils - MetaCPAN" href="https://metacpan.org/dist/List-MoreUtils/releases.rss" />
        <link rel="canonical" href="./List::MoreUtils.html" />
        <meta name="description" content="Provide the stuff missing in List::Util" />
        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=5">
        <link rel="shortcut icon" href="https://metacpan.org/static/icons/favicon.ico">
        <link rel="apple-touch-icon" sizes="152x152" href="https://metacpan.org/static/icons/apple-touch-icon.png">
        <link rel="search" href="https://metacpan.org/static/opensearch.xml" type="application/opensearchdescription+xml" title="MetaCPAN">
        <script>
          (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
          (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
          m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
          })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

          (function(skey, ga_id){
            ga('create', ga_id, {
              siteSpeedSampleRate : 100,
              storage             : 'none',
              clientId            : localStorage.getItem(skey)
            });
            ga(function(tracker) {
              localStorage.setItem(skey, tracker.get('clientId'));
            });
            ga('send', 'pageview');
          })('ga:clientId', 'UA-27829474-1');
        </script>
<meta name="twitter:card"        content="summary" />
<meta name="twitter:url"         content="https://metacpan.org/pod/List::MoreUtils" />
<meta name="twitter:title"       content="List::MoreUtils" />
<meta name="twitter:description" content="Provide the stuff missing in List::Util" />
<meta name="twitter:site"        content="metacpan" />
    </head>
    <body>
        <nav class="navbar navbar-default" role="navigation">
            <div class="header-logo-large hidden-xs">
              <a href="https://metacpan.org/" tabindex="0">
                <svg class="logo" aria-label="MetaCPAN">
                  <use class="logo" href="/static/images/metacpan-logo.svg#logo" />
                </svg>
              </a>
            </div>
            <div class="header-logo-icon visible-xs">
              <a href="https://metacpan.org/">
                <svg class="logo" aria-label="MetaCPAN">
                  <use class="logo" href="/static/images/metacpan-logo.svg#dots" />
                </svg>
              </a>
            </div>
            <ul class="nav navbar-nav menu-items hidden-xs hidden-sm">
              <li><a href="https://metacpan.org/about">About</a></li>
              <li><a href="https://metacpan.org/about/sponsors">Sponsor</a></li>
              <li><a href="https://grep.metacpan.org/">grep::cpan</a></li>
              <li><a href="https://metacpan.org/recent">Recent</a></li>
              <li><a href="https://metacpan.org/about/faq">FAQ</a></li>
              <li><a href="https://metacpan.org/tools">Tools</a></li>
              <li><a href="https://fastapi.metacpan.org/">API</a></li>
            </ul>
            <ul class="nav navbar-nav navbar-right">
                <button type="button" class="searchbar-btn visible-xs visible-sm">
                    <i class="fa fa-search button-fa-icon"></i>
                </button>
                <form action="https://metacpan.org/search" class="searchbar-form visible-md visible-lg search-form form-horizontal">
                   <input type="hidden" name="size" id="metacpan_search-size" value="20">
                  <div class="form-group">
                      <div class="search-group">
                        <i class="fa fa-search"></i>
                        <input type="text" name="q" placeholder="Search the CPAN" size="41" autocorrect="off" autocapitalize="off" spellcheck="false" id="metacpan_search-input" class="form-control" value="">
                      </div>
                  </div>
                </form>
                    <li class="icon-slidepanel visible-xs visible-sm">
                      <button data-toggle="slidepanel" data-target=".slidepanel">
                        <span class="button-fa-icon">
                          <i class="fa fa-bars slidepanel-open"></i>
                          <i class="fa fa-times slidepanel-close"></i>
                        </span>
                      </button>
                    </li>
                <form action="https://metacpan.org/account/logout" method="POST" id="metacpan-logout"></form>
                <li class="dropdown logged_in" style="display: none;">
                    <button type="button" class="dropdown-toggle" data-toggle="dropdown">
                      <i class="fa fa-user button-fa-icon logged-in-icon" aria-hidden="true"></i>
                      <i class="fas fa-chevron-down"></i>
                    </button>
                    <ul class="dropdown-menu">
                        <li><a href="https://metacpan.org/account/identities">Identities</a></li>
                        <li><a href="https://metacpan.org/account/profile">Profile</a></li>
                        <li><a href="https://metacpan.org/account/favorite/list">Favorites</a></li>
                        <li>
                            <a href="./List::MoreUtils.html#" type="button" onclick="$('#metacpan-logout').submit(); return false">
                              Logout
                            </a>
                        </li>
                    </ul>
                </li>
                <li class="dropdown logged_out" style="display: none;">
                    <button type="button" class="dropdown-toggle" data-toggle="dropdown">
                      <i class="fa fa-user button-fa-icon" aria-hidden="true"></i>
                      <i class="fas fa-chevron-down"></i>
                    </button>
                    <ul class="dropdown-menu">
                        <li>
                            <a href="https://metacpan.org/login/github">
                                <i class="fab fa-github fa-fw"></i>
                                GitHub
                            </a>
                        </li>
                        <li>
                            <a href="https://metacpan.org/login/twitter">
                                <i class="fab fa-twitter fa-fw"></i>
                                Twitter
                            </a>
                        </li>
                        <li>
                            <a href="https://metacpan.org/login/google">
                                <i class="fab fa-google fa-fw"></i>
                                Google
                            </a>
                        </li>
                    </ul>
                </li>
                <li class="dropdown logged_placeholder">
                    <button>
                      <i class="fa fa-user button-fa-icon" aria-hidden="true"></i>
                    </button>
                </li>
            </ul>
        </nav>
        <div class="page-content ">
          <!--
          <div class="top-notify-banner">
            <i class="fas fa-info-circle"></i>
          </div>
          -->
          <nav class="sidebar">
            <div class="slidepanel">
              <ul class="nav-list ">
    <li class="nav-header no-margin-top">
      <div class="ttip" data-toggle="tooltip" data-placement="bottom" title="The date that this version of List-MoreUtils was released.">
      <span class="relatize">21 Oct 2020 14:55:08 UTC</span>
    </li>
  <li>
    Distribution: <a href="https://metacpan.org/dist/List-MoreUtils">List-MoreUtils</a>
  </li>
  <li>
    Module version: 0.430
  </li>
  <li>
    <a data-keyboard-shortcut="g s" href="https://metacpan.org/dist/List-MoreUtils/source/lib/List/MoreUtils.pm">Source</a>
    (<a href="https://metacpan.org/dist/List-MoreUtils/source/lib/List/MoreUtils.pm?raw=1">raw</a>)
  </li>
  <li>
    <a data-keyboard-shortcut="g b" href="https://metacpan.org/dist/List-MoreUtils/source/lib/List">Browse</a>
    (<a href="https://metacpan.org/dist/List-MoreUtils/source/lib/List?raw=1">raw</a>)
  </li>
    <li>
      <a data-keyboard-shortcut="g c" href="https://metacpan.org/dist/List-MoreUtils/changes">Changes</a>
    </li>
    <li>
      <a rel="noopener nofollow" class="nopopup" href="https://metacpan.org/release/List-MoreUtils">Homepage</a>
    </li>
    <li>
      <a class="nopopup" href="https://metacpan.org/dist/List-MoreUtils/contribute">How to Contribute</a>
    </li>
    <li>
        <a rel="noopener nofollow" data-keyboard-shortcut="g r" href="https://github.com/perl5-utils/List-MoreUtils">Repository</a>
    </li>
    <li>
      <a rel="noopener nofollow" data-keyboard-shortcut="g i" href="https://rt.cpan.org/Dist/Display.html?Name=List-MoreUtils">Issues</a>
      (14)
    </li>
    <li>
      <a rel="noopener nofollow" href="http://matrix.cpantesters.org/?dist=List-MoreUtils+0.430" title="Matrix">Testers</a>
        <span title="(pass / fail / na)">(<a rel="noopener nofollow" href="https://www.cpantesters.org/distro/L/List-MoreUtils.html?oncpan=1&amp;distmat=1&amp;version=0.430&amp;grade=2" style="color: #090">6780</a> / <a rel="noopener nofollow" href="https://www.cpantesters.org/distro/L/List-MoreUtils.html?oncpan=1&amp;distmat=1&amp;version=0.430&amp;grade=3" style="color: #900">4</a> / <a rel="noopener nofollow" href="https://www.cpantesters.org/distro/L/List-MoreUtils.html?oncpan=1&amp;distmat=1&amp;version=0.430&amp;grade=4">0</a>)</span>
    </li>
    <li>
      <a rel="noopener nofollow" href="http://cpants.cpanauthors.org/release/REHSACK/List-MoreUtils-0.430">Kwalitee</a>
    </li>
    <li>
      <div class="ttip" data-toggle="tooltip" data-placement="bottom" title="The # people with an indexing permission on List-MoreUtils who have released something to CPAN in the last 2 years (i.e. the # people likely able to release critical fixes in a timely manner)">
      Bus factor: 0
      </div>
    </li>
    <li>
      <a rel="noopener nofollow" href="http://cpancover.com/latest/List-MoreUtils-0.430/index.html">% Coverage </a>
    </li>
    <li>
      License: apache_2_0
    </li>
    <li class="nav-header">Activity</li>
    <li>
<div class="activity-graph">
    <img src="https://metacpan.org/dist/List-MoreUtils/activity.svg?res=month" />
    <div class="comment">24 month</div>
</div>
    </li>
    <li class="nav-header">Tools</li>
    <li>
      <a itemprop="downloadUrl" href="https://cpan.metacpan.org/authors/id/R/RE/REHSACK/List-MoreUtils-0.430.tar.gz">
      Download (<span itemprop="fileSize">147.04KB</span>)</a>
    </li>
    <li>
      <a href="https://explorer.metacpan.org/?url=%2Fmodule%2FREHSACK%2FList-MoreUtils-0.430%2Flib%2FList%2FMoreUtils.pm">
        MetaCPAN Explorer
      </a>
    </li>
    <li>
      <a href="https://metacpan.org/dist/List-MoreUtils/permissions">
        Permissions
      </a>
    </li>
    <li>
      <a href="https://metacpan.org/dist/List-MoreUtils/releases.rss">
        Subscribe to distribution
      </a>
    </li>
    <li>
      <button class="btn btn-link" data-toggle="modal" data-target="#metacpan_install-instructions-dialog">
        Install Instructions
      </button>
    </li>
    <li>
      <form action="https://metacpan.org/search">
        <input type="hidden" name="q" value="dist:List-MoreUtils">
        <input type="search" name="q" placeholder="Search distribution" class="form-control tool-bar-form">
        <input type="submit" style="display: none">
      </form>
    </li>
    <li>
      <form action="https://grep.metacpan.org/search">
        <input type="hidden" name="qd" value="List-MoreUtils">
        <input type="hidden" name="source" value="metacpan">
        <input type="search" name="q" placeholder="grep distribution" class="form-control tool-bar-form">
        <input type="submit" style="display: none">
     </form>
    </li>
    <li class="version-jump">
<select onchange="document.location.href=&#39;/release/&#39;+this.value+&#39;/view/lib/List/MoreUtils.pm&#39;" class="form-control tool-bar-form">
  <option disabled selected>Jump to version</option>
<option
  disabled
  value="REHSACK/List-MoreUtils-0.430"
>0.430
  (REHSACK on 2020-10-21)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.429_001"
>0.429_001 DEV
  (REHSACK on 2020-10-05)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.428"
>0.428
  (REHSACK on 2017-12-11)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.427_001"
>0.427_001 DEV
  (REHSACK on 2017-11-06)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.426"
>0.426
  (REHSACK on 2017-10-12)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.425_002"
>0.425_002 DEV
  (REHSACK on 2017-10-05)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.425_001"
>0.425_001 DEV
  (REHSACK on 2017-09-27)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.425"
>0.425
  (REHSACK on 2017-09-06)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.424_001"
>0.424_001 DEV
  (REHSACK on 2017-09-05)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.423"
>0.423
  (REHSACK on 2017-08-22)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.420_001"
>0.420_001 DEV
  (REHSACK on 2017-08-15)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.419"
>0.419
  (REHSACK on 2017-04-06)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.418"
>0.418
  (REHSACK on 2017-03-29)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.417_001"
>0.417_001 DEV
  (REHSACK on 2017-03-21)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.416"
>0.416
  (REHSACK on 2016-07-06)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.415"
>0.415
  (REHSACK on 2016-05-01)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.414_001"
>0.414_001 DEV
  (REHSACK on 2016-04-13)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.413"
>0.413
  (REHSACK on 2015-06-10)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.412"
>0.412
  (REHSACK on 2015-05-19)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.411_001"
>0.411_001 DEV
  (REHSACK on 2015-05-11)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.410"
>0.410
  (REHSACK on 2015-03-30)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.409_003"
>0.409_003 DEV
  (REHSACK on 2015-03-27)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.409_002"
>0.409_002 DEV
  (REHSACK on 2015-03-23)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.409_001"
>0.409_001 DEV
  (REHSACK on 2015-03-21)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.408"
>0.408
  (REHSACK on 2015-03-18)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.406"
>0.406
  (REHSACK on 2015-03-03)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.405"
>0.405
  (REHSACK on 2015-02-14)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.404"
>0.404
  (REHSACK on 2015-01-28)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.403"
>0.403
  (REHSACK on 2015-01-27)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.402"
>0.402
  (REHSACK on 2014-12-27)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.401"
>0.401
  (REHSACK on 2014-12-19)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.400_010"
>0.400_010 DEV
  (REHSACK on 2014-12-08)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.400_009"
>0.400_009 DEV
  (REHSACK on 2014-05-05)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.400_007"
>0.400_007 DEV
  (REHSACK on 2014-04-25)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.400_008"
>0.400_008 DEV
  (REHSACK on 2014-04-25)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.400_006"
>0.400_006 DEV
  (REHSACK on 2014-04-01)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.400_005"
>0.400_005 DEV
  (REHSACK on 2014-03-24)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.400_004"
>0.400_004 DEV
  (REHSACK on 2014-03-21)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.400_003"
>0.400_003 DEV
  (REHSACK on 2014-03-18)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.400_002"
>0.400_002 DEV
  (REHSACK on 2014-03-16)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.400_001"
>0.400_001 DEV
  (REHSACK on 2013-10-11)</option>
<option
  
  value="RURBAN/List-MoreUtils-0.33_007"
>0.33_007 DEV
  (RURBAN on 2012-12-31)</option>
<option
  
  value="RURBAN/List-MoreUtils-0.33_005"
>0.33_005 DEV
  (RURBAN on 2012-11-13)</option>
<option
  
  value="ADAMK/List-MoreUtils-0.33"
>0.33
  (ADAMK on 2011-08-04)</option>
<option
  
  value="ADAMK/List-MoreUtils-0.32"
>0.32
  (ADAMK on 2011-05-20)</option>
<option
  
  value="ADAMK/List-MoreUtils-0.31_02"
>0.31_02 DEV
  (ADAMK on 2011-03-21)</option>
<option
  
  value="ADAMK/List-MoreUtils-0.31_01"
>0.31_01 DEV
  (ADAMK on 2011-03-21)</option>
<option
  
  value="ADAMK/List-MoreUtils-0.30"
>0.30
  (ADAMK on 2010-12-16)</option>
<option
  
  value="ADAMK/List-MoreUtils-0.29"
>0.29
  (ADAMK on 2010-12-08)</option>
<option
  
  value="ADAMK/List-MoreUtils-0.28"
>0.28
  (ADAMK on 2010-12-07)</option>
<option
  
  value="ADAMK/List-MoreUtils-0.27_04"
>0.27_04 DEV
  (ADAMK on 2010-12-06)</option>
<option
  
  value="ADAMK/List-MoreUtils-0.27_03"
>0.27_03 DEV
  (ADAMK on 2010-12-06)</option>
<option
  
  value="ADAMK/List-MoreUtils-0.27_02"
>0.27_02 DEV
  (ADAMK on 2010-12-03)</option>
<option
  
  value="ADAMK/List-MoreUtils-0.27_01"
>0.27_01 DEV
  (ADAMK on 2010-12-01)</option>
<option
  
  value="ADAMK/List-MoreUtils-0.26"
>0.26
  (ADAMK on 2010-11-23)</option>
<option
  
  value="ADAMK/List-MoreUtils-0.24"
>0.24
  (ADAMK on 2010-11-22)</option>
<option
  
  value="ADAMK/List-MoreUtils-0.23_01"
>0.23_01 DEV
  (ADAMK on 2010-09-25)</option>
<option
  
  value="VPARSEVAL/List-MoreUtils-0.25_02"
>0.25_02 DEV
  (VPARSEVAL on 2009-08-01)</option>
<option
  
  value="VPARSEVAL/List-MoreUtils-0.25_01"
>0.25_01 DEV
  (VPARSEVAL on 2009-07-30)</option>
<option
  
  value="VPARSEVAL/List-MoreUtils-0.22"
>0.22
  (VPARSEVAL on 2006-07-02)</option>
<option
  
  value="VPARSEVAL/List-MoreUtils-0.21"
>0.21
  (VPARSEVAL on 2006-06-18)</option>
<option
  
  value="VPARSEVAL/List-MoreUtils-0.20"
>0.20
  (VPARSEVAL on 2006-06-10)</option>
<option
  
  value="VPARSEVAL/List-MoreUtils-0.19"
>0.19
  (VPARSEVAL on 2006-03-13)</option>
<option
  
  value="VPARSEVAL/List-MoreUtils-0.18"
>0.18
  (VPARSEVAL on 2006-02-25)</option>
<option
  
  value="VPARSEVAL/List-MoreUtils-0.17"
>0.17
  (VPARSEVAL on 2005-12-07)</option>
<option
  
  value="VPARSEVAL/List-MoreUtils-0.16"
>0.16
  (VPARSEVAL on 2005-11-14)</option>
<option
  
  value="VPARSEVAL/List-MoreUtils-0.15"
>0.15
  (VPARSEVAL on 2005-11-11)</option>
<option
  
  value="VPARSEVAL/List-MoreUtils-0.14"
>0.14
  (VPARSEVAL on 2005-11-10)</option>
<option
  
  value="VPARSEVAL/List-MoreUtils-0.13"
>0.13
  (VPARSEVAL on 2005-11-09)</option>
<option
  
  value="VPARSEVAL/List-MoreUtils-0.12"
>0.12
  (VPARSEVAL on 2005-09-28)</option>
<option
  
  value="VPARSEVAL/List-MoreUtils-0.11"
>0.11
  (VPARSEVAL on 2005-09-27)</option>
<option
  
  value="VPARSEVAL/List-MoreUtils-0.10"
>0.10
  (VPARSEVAL on 2005-04-01)</option>
<optgroup label="BackPAN">'
<option
  
  value="REHSACK/List-MoreUtils-0.407"
>0.407
  (REHSACK on 2015-03-17)</option>
<option
  
  value="VPARSEVAL/List-MoreUtils-0.24"
>0.24
  (VPARSEVAL on 2009-07-26)</option>
<option
  
  value="VPARSEVAL/List-MoreUtils-0.09"
>0.09
  (VPARSEVAL on 2004-12-04)</option>
<option
  
  value="VPARSEVAL/List-MoreUtils-0.08"
>0.08
  (VPARSEVAL on 2004-12-03)</option>
<option
  
  value="VPARSEVAL/List-MoreUtils-0.07"
>0.07
  (VPARSEVAL on 2004-12-01)</option>
<option
  
  value="VPARSEVAL/List-MoreUtils-0.06"
>0.06
  (VPARSEVAL on 2004-11-14)</option>
<option
  
  value="VPARSEVAL/List-MoreUtils-0.05"
>0.05
  (VPARSEVAL on 2004-09-18)</option>
<option
  
  value="VPARSEVAL/List-MoreUtils-0.04"
>0.04
  (VPARSEVAL on 2004-07-10)</option>
</optgroup>
</select>
    </li>
    <li class="version-diff">
<select onchange="document.location.href='/release/REHSACK/List-MoreUtils-0.430/diff/' + encodeURIComponent(this.value) + '/lib/List/MoreUtils.pm'
" class="form-control tool-bar-form">
  <option disabled selected>Diff with version</option>
<option
  disabled
  value="REHSACK/List-MoreUtils-0.430"
>0.430
  (REHSACK on 2020-10-21)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.429_001"
>0.429_001 DEV
  (REHSACK on 2020-10-05)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.428"
>0.428
  (REHSACK on 2017-12-11)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.427_001"
>0.427_001 DEV
  (REHSACK on 2017-11-06)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.426"
>0.426
  (REHSACK on 2017-10-12)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.425_002"
>0.425_002 DEV
  (REHSACK on 2017-10-05)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.425_001"
>0.425_001 DEV
  (REHSACK on 2017-09-27)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.425"
>0.425
  (REHSACK on 2017-09-06)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.424_001"
>0.424_001 DEV
  (REHSACK on 2017-09-05)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.423"
>0.423
  (REHSACK on 2017-08-22)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.420_001"
>0.420_001 DEV
  (REHSACK on 2017-08-15)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.419"
>0.419
  (REHSACK on 2017-04-06)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.418"
>0.418
  (REHSACK on 2017-03-29)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.417_001"
>0.417_001 DEV
  (REHSACK on 2017-03-21)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.416"
>0.416
  (REHSACK on 2016-07-06)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.415"
>0.415
  (REHSACK on 2016-05-01)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.414_001"
>0.414_001 DEV
  (REHSACK on 2016-04-13)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.413"
>0.413
  (REHSACK on 2015-06-10)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.412"
>0.412
  (REHSACK on 2015-05-19)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.411_001"
>0.411_001 DEV
  (REHSACK on 2015-05-11)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.410"
>0.410
  (REHSACK on 2015-03-30)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.409_003"
>0.409_003 DEV
  (REHSACK on 2015-03-27)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.409_002"
>0.409_002 DEV
  (REHSACK on 2015-03-23)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.409_001"
>0.409_001 DEV
  (REHSACK on 2015-03-21)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.408"
>0.408
  (REHSACK on 2015-03-18)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.406"
>0.406
  (REHSACK on 2015-03-03)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.405"
>0.405
  (REHSACK on 2015-02-14)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.404"
>0.404
  (REHSACK on 2015-01-28)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.403"
>0.403
  (REHSACK on 2015-01-27)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.402"
>0.402
  (REHSACK on 2014-12-27)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.401"
>0.401
  (REHSACK on 2014-12-19)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.400_010"
>0.400_010 DEV
  (REHSACK on 2014-12-08)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.400_009"
>0.400_009 DEV
  (REHSACK on 2014-05-05)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.400_007"
>0.400_007 DEV
  (REHSACK on 2014-04-25)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.400_008"
>0.400_008 DEV
  (REHSACK on 2014-04-25)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.400_006"
>0.400_006 DEV
  (REHSACK on 2014-04-01)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.400_005"
>0.400_005 DEV
  (REHSACK on 2014-03-24)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.400_004"
>0.400_004 DEV
  (REHSACK on 2014-03-21)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.400_003"
>0.400_003 DEV
  (REHSACK on 2014-03-18)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.400_002"
>0.400_002 DEV
  (REHSACK on 2014-03-16)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.400_001"
>0.400_001 DEV
  (REHSACK on 2013-10-11)</option>
<option
  
  value="RURBAN/List-MoreUtils-0.33_007"
>0.33_007 DEV
  (RURBAN on 2012-12-31)</option>
<option
  
  value="RURBAN/List-MoreUtils-0.33_005"
>0.33_005 DEV
  (RURBAN on 2012-11-13)</option>
<option
  
  value="ADAMK/List-MoreUtils-0.33"
>0.33
  (ADAMK on 2011-08-04)</option>
<option
  
  value="ADAMK/List-MoreUtils-0.32"
>0.32
  (ADAMK on 2011-05-20)</option>
<option
  
  value="ADAMK/List-MoreUtils-0.31_02"
>0.31_02 DEV
  (ADAMK on 2011-03-21)</option>
<option
  
  value="ADAMK/List-MoreUtils-0.31_01"
>0.31_01 DEV
  (ADAMK on 2011-03-21)</option>
<option
  
  value="ADAMK/List-MoreUtils-0.30"
>0.30
  (ADAMK on 2010-12-16)</option>
<option
  
  value="ADAMK/List-MoreUtils-0.29"
>0.29
  (ADAMK on 2010-12-08)</option>
<option
  
  value="ADAMK/List-MoreUtils-0.28"
>0.28
  (ADAMK on 2010-12-07)</option>
<option
  
  value="ADAMK/List-MoreUtils-0.27_04"
>0.27_04 DEV
  (ADAMK on 2010-12-06)</option>
<option
  
  value="ADAMK/List-MoreUtils-0.27_03"
>0.27_03 DEV
  (ADAMK on 2010-12-06)</option>
<option
  
  value="ADAMK/List-MoreUtils-0.27_02"
>0.27_02 DEV
  (ADAMK on 2010-12-03)</option>
<option
  
  value="ADAMK/List-MoreUtils-0.27_01"
>0.27_01 DEV
  (ADAMK on 2010-12-01)</option>
<option
  
  value="ADAMK/List-MoreUtils-0.26"
>0.26
  (ADAMK on 2010-11-23)</option>
<option
  
  value="ADAMK/List-MoreUtils-0.24"
>0.24
  (ADAMK on 2010-11-22)</option>
<option
  
  value="ADAMK/List-MoreUtils-0.23_01"
>0.23_01 DEV
  (ADAMK on 2010-09-25)</option>
<option
  
  value="VPARSEVAL/List-MoreUtils-0.25_02"
>0.25_02 DEV
  (VPARSEVAL on 2009-08-01)</option>
<option
  
  value="VPARSEVAL/List-MoreUtils-0.25_01"
>0.25_01 DEV
  (VPARSEVAL on 2009-07-30)</option>
<option
  
  value="VPARSEVAL/List-MoreUtils-0.22"
>0.22
  (VPARSEVAL on 2006-07-02)</option>
<option
  
  value="VPARSEVAL/List-MoreUtils-0.21"
>0.21
  (VPARSEVAL on 2006-06-18)</option>
<option
  
  value="VPARSEVAL/List-MoreUtils-0.20"
>0.20
  (VPARSEVAL on 2006-06-10)</option>
<option
  
  value="VPARSEVAL/List-MoreUtils-0.19"
>0.19
  (VPARSEVAL on 2006-03-13)</option>
<option
  
  value="VPARSEVAL/List-MoreUtils-0.18"
>0.18
  (VPARSEVAL on 2006-02-25)</option>
<option
  
  value="VPARSEVAL/List-MoreUtils-0.17"
>0.17
  (VPARSEVAL on 2005-12-07)</option>
<option
  
  value="VPARSEVAL/List-MoreUtils-0.16"
>0.16
  (VPARSEVAL on 2005-11-14)</option>
<option
  
  value="VPARSEVAL/List-MoreUtils-0.15"
>0.15
  (VPARSEVAL on 2005-11-11)</option>
<option
  
  value="VPARSEVAL/List-MoreUtils-0.14"
>0.14
  (VPARSEVAL on 2005-11-10)</option>
<option
  
  value="VPARSEVAL/List-MoreUtils-0.13"
>0.13
  (VPARSEVAL on 2005-11-09)</option>
<option
  
  value="VPARSEVAL/List-MoreUtils-0.12"
>0.12
  (VPARSEVAL on 2005-09-28)</option>
<option
  
  value="VPARSEVAL/List-MoreUtils-0.11"
>0.11
  (VPARSEVAL on 2005-09-27)</option>
<option
  
  value="VPARSEVAL/List-MoreUtils-0.10"
>0.10
  (VPARSEVAL on 2005-04-01)</option>
<optgroup label="BackPAN">'
<option
  
  value="REHSACK/List-MoreUtils-0.407"
>0.407
  (REHSACK on 2015-03-17)</option>
<option
  
  value="VPARSEVAL/List-MoreUtils-0.24"
>0.24
  (VPARSEVAL on 2009-07-26)</option>
<option
  
  value="VPARSEVAL/List-MoreUtils-0.09"
>0.09
  (VPARSEVAL on 2004-12-04)</option>
<option
  
  value="VPARSEVAL/List-MoreUtils-0.08"
>0.08
  (VPARSEVAL on 2004-12-03)</option>
<option
  
  value="VPARSEVAL/List-MoreUtils-0.07"
>0.07
  (VPARSEVAL on 2004-12-01)</option>
<option
  
  value="VPARSEVAL/List-MoreUtils-0.06"
>0.06
  (VPARSEVAL on 2004-11-14)</option>
<option
  
  value="VPARSEVAL/List-MoreUtils-0.05"
>0.05
  (VPARSEVAL on 2004-09-18)</option>
<option
  
  value="VPARSEVAL/List-MoreUtils-0.04"
>0.04
  (VPARSEVAL on 2004-07-10)</option>
</optgroup>
</select>
    </li>

    <li>
<ul class="dependencies">
  <li class="nav-header">Dependencies</li>
  <li><a href="https://metacpan.org/pod/Exporter::Tiny" title="Exporter::Tiny" class="ellipsis">Exporter::Tiny</a></li>
  <li><a href="https://metacpan.org/pod/List::MoreUtils::XS" title="List::MoreUtils::XS" class="ellipsis">List::MoreUtils::XS</a></li>
  <li><i class="ttip" title="dynamic_config enabled">and possibly others</i></li>
  <li>
    <hr>
  </li>
  <li>
    <a href="https://metacpan.org/module/List::MoreUtils/requires">Reverse dependencies</a>
  </li>
  <li>
    <a href="http://deps.cpantesters.org/?module=List%3A%3AMoreUtils">CPAN Testers List</a>
  </li>
  <li>
    <a href="https://cpandeps.grinnz.com/?dist=List-MoreUtils">Dependency graph</a>
  </li>
</ul>
    </li>
    <li class="nav-header">Permalinks</li>
    <li>
      <a href="https://metacpan.org/release/REHSACK/List-MoreUtils-0.430/view/lib/List/MoreUtils.pm">This version</a>
    </li>
    <li>
      <a href="./List::MoreUtils.html">Latest version</a>
    </li>
    <li>
<div class="plussers">
<div class="nav-header">++ed by:</div>
<div>
<a class="display-all" href="https://metacpan.org/author/MISHIN"><img src="https://www.gravatar.com/avatar/7aefe037fc617ef89780ad89de3deb87?d=identicon&amp;s=20" title="MISHIN" alt="MISHIN"></a>
<a class="display-all" href="https://metacpan.org/author/IONCACHE"><img src="https://www.gravatar.com/avatar/89104535cbfebfedb5390bc808dce407?d=identicon&amp;s=20" title="IONCACHE" alt="IONCACHE"></a>
<a class="display-all" href="https://metacpan.org/author/PHAYLON"><img src="https://www.gravatar.com/avatar/32ab988963e09ce6fbda10b86b030470?d=identicon&amp;s=20" title="PHAYLON" alt="PHAYLON"></a>
<a class="display-all" href="https://metacpan.org/author/JKUTEJ"><img src="https://www.gravatar.com/avatar/dd8704659cdd56fa6c4d1ba5b0909c69?d=identicon&amp;s=20" title="JKUTEJ" alt="JKUTEJ"></a>
<a class="display-all" href="https://metacpan.org/author/DBOEHMER"><img src="https://www.gravatar.com/avatar/220fbe10dba79664fe84771d5ea32763?d=identicon&amp;s=20" title="DBOEHMER" alt="DBOEHMER"></a>
</div>
<!-- Display counts of plussers-->
<div>
    <a href="https://metacpan.org/dist/List-MoreUtils/plussers">71 PAUSE users</a>
</div>
<div>
    45 non-PAUSE users
</div>
</div>
    </li>
    <li>
<div id="metacpan_contributors">
  <div>
    <button class="btn-link"
      onclick="$(this).hide(); $('#metacpan_contributors ul').slideDown(); return false;"
    >and 2 contributors</button>
  </div>
  <ul style="display: none">
    <li class="contributor"
      data-cpan-author="VPARSEVAL"
      data-contrib-email="tassilo.von.parseval@rwth-aachen.de"
    >
      <a href="https://metacpan.org/author/VPARSEVAL" class="cpan-author">
      <img class="gravatar" width="20" height="20" src="https://www.gravatar.com/avatar/e1ff375377ad97efe7fe497bf1fd73bf?d=identicon&amp;s=20" />
      Tassilo von Parseval
      </a>
    </li>
    <li class="contributor"
      data-cpan-author="ADAMK"
      data-contrib-email="adamk@cpan.org"
    >
      <a href="https://metacpan.org/author/ADAMK" class="cpan-author">
      <img class="gravatar" width="20" height="20" src="https://www.gravatar.com/avatar/884124d0169f41668fb3f948b2ba8b0a?d=identicon&amp;s=20" />
      Adam Kennedy
      </a>
    </li>
  </ul>
</div>
    </li>
              </ul>
            </div>
          </nav>
          <div class="content-navigation">
<div class="breadcrumbs">
  <span>
    <a data-keyboard-shortcut="g a" rel="author" href="https://metacpan.org/author/REHSACK" class="author-name">Jens Rehsack</a>
  </span>
  <span>&nbsp;/&nbsp;</span>
  <div class="release dist-release status-latest maturity-released">
    <span class="dropdown"><b class="caret"></b></span>
<select onchange="document.location.href=&#39;/release/&#39;+this.value+&#39;/view/lib/List/MoreUtils.pm&#39;" class="">
<option
  selected
  value="REHSACK/List-MoreUtils-0.430"
>0.430
  (REHSACK on 2020-10-21)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.429_001"
>0.429_001 DEV
  (REHSACK on 2020-10-05)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.428"
>0.428
  (REHSACK on 2017-12-11)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.427_001"
>0.427_001 DEV
  (REHSACK on 2017-11-06)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.426"
>0.426
  (REHSACK on 2017-10-12)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.425_002"
>0.425_002 DEV
  (REHSACK on 2017-10-05)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.425_001"
>0.425_001 DEV
  (REHSACK on 2017-09-27)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.425"
>0.425
  (REHSACK on 2017-09-06)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.424_001"
>0.424_001 DEV
  (REHSACK on 2017-09-05)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.423"
>0.423
  (REHSACK on 2017-08-22)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.420_001"
>0.420_001 DEV
  (REHSACK on 2017-08-15)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.419"
>0.419
  (REHSACK on 2017-04-06)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.418"
>0.418
  (REHSACK on 2017-03-29)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.417_001"
>0.417_001 DEV
  (REHSACK on 2017-03-21)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.416"
>0.416
  (REHSACK on 2016-07-06)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.415"
>0.415
  (REHSACK on 2016-05-01)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.414_001"
>0.414_001 DEV
  (REHSACK on 2016-04-13)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.413"
>0.413
  (REHSACK on 2015-06-10)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.412"
>0.412
  (REHSACK on 2015-05-19)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.411_001"
>0.411_001 DEV
  (REHSACK on 2015-05-11)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.410"
>0.410
  (REHSACK on 2015-03-30)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.409_003"
>0.409_003 DEV
  (REHSACK on 2015-03-27)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.409_002"
>0.409_002 DEV
  (REHSACK on 2015-03-23)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.409_001"
>0.409_001 DEV
  (REHSACK on 2015-03-21)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.408"
>0.408
  (REHSACK on 2015-03-18)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.406"
>0.406
  (REHSACK on 2015-03-03)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.405"
>0.405
  (REHSACK on 2015-02-14)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.404"
>0.404
  (REHSACK on 2015-01-28)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.403"
>0.403
  (REHSACK on 2015-01-27)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.402"
>0.402
  (REHSACK on 2014-12-27)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.401"
>0.401
  (REHSACK on 2014-12-19)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.400_010"
>0.400_010 DEV
  (REHSACK on 2014-12-08)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.400_009"
>0.400_009 DEV
  (REHSACK on 2014-05-05)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.400_007"
>0.400_007 DEV
  (REHSACK on 2014-04-25)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.400_008"
>0.400_008 DEV
  (REHSACK on 2014-04-25)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.400_006"
>0.400_006 DEV
  (REHSACK on 2014-04-01)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.400_005"
>0.400_005 DEV
  (REHSACK on 2014-03-24)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.400_004"
>0.400_004 DEV
  (REHSACK on 2014-03-21)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.400_003"
>0.400_003 DEV
  (REHSACK on 2014-03-18)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.400_002"
>0.400_002 DEV
  (REHSACK on 2014-03-16)</option>
<option
  
  value="REHSACK/List-MoreUtils-0.400_001"
>0.400_001 DEV
  (REHSACK on 2013-10-11)</option>
<option
  
  value="RURBAN/List-MoreUtils-0.33_007"
>0.33_007 DEV
  (RURBAN on 2012-12-31)</option>
<option
  
  value="RURBAN/List-MoreUtils-0.33_005"
>0.33_005 DEV
  (RURBAN on 2012-11-13)</option>
<option
  
  value="ADAMK/List-MoreUtils-0.33"
>0.33
  (ADAMK on 2011-08-04)</option>
<option
  
  value="ADAMK/List-MoreUtils-0.32"
>0.32
  (ADAMK on 2011-05-20)</option>
<option
  
  value="ADAMK/List-MoreUtils-0.31_02"
>0.31_02 DEV
  (ADAMK on 2011-03-21)</option>
<option
  
  value="ADAMK/List-MoreUtils-0.31_01"
>0.31_01 DEV
  (ADAMK on 2011-03-21)</option>
<option
  
  value="ADAMK/List-MoreUtils-0.30"
>0.30
  (ADAMK on 2010-12-16)</option>
<option
  
  value="ADAMK/List-MoreUtils-0.29"
>0.29
  (ADAMK on 2010-12-08)</option>
<option
  
  value="ADAMK/List-MoreUtils-0.28"
>0.28
  (ADAMK on 2010-12-07)</option>
<option
  
  value="ADAMK/List-MoreUtils-0.27_04"
>0.27_04 DEV
  (ADAMK on 2010-12-06)</option>
<option
  
  value="ADAMK/List-MoreUtils-0.27_03"
>0.27_03 DEV
  (ADAMK on 2010-12-06)</option>
<option
  
  value="ADAMK/List-MoreUtils-0.27_02"
>0.27_02 DEV
  (ADAMK on 2010-12-03)</option>
<option
  
  value="ADAMK/List-MoreUtils-0.27_01"
>0.27_01 DEV
  (ADAMK on 2010-12-01)</option>
<option
  
  value="ADAMK/List-MoreUtils-0.26"
>0.26
  (ADAMK on 2010-11-23)</option>
<option
  
  value="ADAMK/List-MoreUtils-0.24"
>0.24
  (ADAMK on 2010-11-22)</option>
<option
  
  value="ADAMK/List-MoreUtils-0.23_01"
>0.23_01 DEV
  (ADAMK on 2010-09-25)</option>
<option
  
  value="VPARSEVAL/List-MoreUtils-0.25_02"
>0.25_02 DEV
  (VPARSEVAL on 2009-08-01)</option>
<option
  
  value="VPARSEVAL/List-MoreUtils-0.25_01"
>0.25_01 DEV
  (VPARSEVAL on 2009-07-30)</option>
<option
  
  value="VPARSEVAL/List-MoreUtils-0.22"
>0.22
  (VPARSEVAL on 2006-07-02)</option>
<option
  
  value="VPARSEVAL/List-MoreUtils-0.21"
>0.21
  (VPARSEVAL on 2006-06-18)</option>
<option
  
  value="VPARSEVAL/List-MoreUtils-0.20"
>0.20
  (VPARSEVAL on 2006-06-10)</option>
<option
  
  value="VPARSEVAL/List-MoreUtils-0.19"
>0.19
  (VPARSEVAL on 2006-03-13)</option>
<option
  
  value="VPARSEVAL/List-MoreUtils-0.18"
>0.18
  (VPARSEVAL on 2006-02-25)</option>
<option
  
  value="VPARSEVAL/List-MoreUtils-0.17"
>0.17
  (VPARSEVAL on 2005-12-07)</option>
<option
  
  value="VPARSEVAL/List-MoreUtils-0.16"
>0.16
  (VPARSEVAL on 2005-11-14)</option>
<option
  
  value="VPARSEVAL/List-MoreUtils-0.15"
>0.15
  (VPARSEVAL on 2005-11-11)</option>
<option
  
  value="VPARSEVAL/List-MoreUtils-0.14"
>0.14
  (VPARSEVAL on 2005-11-10)</option>
<option
  
  value="VPARSEVAL/List-MoreUtils-0.13"
>0.13
  (VPARSEVAL on 2005-11-09)</option>
<option
  
  value="VPARSEVAL/List-MoreUtils-0.12"
>0.12
  (VPARSEVAL on 2005-09-28)</option>
<option
  
  value="VPARSEVAL/List-MoreUtils-0.11"
>0.11
  (VPARSEVAL on 2005-09-27)</option>
<option
  
  value="VPARSEVAL/List-MoreUtils-0.10"
>0.10
  (VPARSEVAL on 2005-04-01)</option>
<optgroup label="BackPAN">'
<option
  
  value="REHSACK/List-MoreUtils-0.407"
>0.407
  (REHSACK on 2015-03-17)</option>
<option
  
  value="VPARSEVAL/List-MoreUtils-0.24"
>0.24
  (VPARSEVAL on 2009-07-26)</option>
<option
  
  value="VPARSEVAL/List-MoreUtils-0.09"
>0.09
  (VPARSEVAL on 2004-12-04)</option>
<option
  
  value="VPARSEVAL/List-MoreUtils-0.08"
>0.08
  (VPARSEVAL on 2004-12-03)</option>
<option
  
  value="VPARSEVAL/List-MoreUtils-0.07"
>0.07
  (VPARSEVAL on 2004-12-01)</option>
<option
  
  value="VPARSEVAL/List-MoreUtils-0.06"
>0.06
  (VPARSEVAL on 2004-11-14)</option>
<option
  
  value="VPARSEVAL/List-MoreUtils-0.05"
>0.05
  (VPARSEVAL on 2004-09-18)</option>
<option
  
  value="VPARSEVAL/List-MoreUtils-0.04"
>0.04
  (VPARSEVAL on 2004-07-10)</option>
</optgroup>
</select>
    <a data-keyboard-shortcut="g d" class="release-name" href="https://metacpan.org/dist/List-MoreUtils">List-MoreUtils-0.430</a>
  </div>
<span class="river-gauge-gauge">
  <svg width="24px"
       height="15px"
       version="1.1"
       xmlns="http://www.w3.org/2000/svg"
       xmlns:xlink="http://www.w3.org/1999/xlink">

    <g>
      <title>        River stage four &#10;
          • 820 direct dependents &#10;          • 3118 total dependents
      </title>

      <rect x="0"  y="0" width="4" height="15" fill="#7ea3f2" />
      <rect x="5"  y="0" width="4" height="15" fill="#7ea3f2" />
      <rect x="10"  y="0" width="4" height="15" fill="#7ea3f2" />
      <rect x="15"  y="0" width="4" height="15" fill="#7ea3f2" />
      <rect x="20"  y="0" width="4" height="15" fill="#e4e2e2" />
    </g>
  </svg>

</span>
<div id="List-MoreUtils-fav" class="logged_in">
<form action="https://metacpan.org/account/favorite/add" style="display: inline" onsubmit="return favDistribution(this)">
    <input type="hidden" name="remove" value="0">
    <input type="hidden" name="release" value="List-MoreUtils-0.430">
    <input type="hidden" name="author" value="REHSACK">
    <input type="hidden" name="distribution" value="List-MoreUtils">
    <button type="submit" class="favorite highlight"><span>116</span> ++</button>
</form>
</div>
<div class="logged_out">
<a href="./List::MoreUtils.html" onclick="alert('Please sign in to add favorites'); return false" class="favorite highlight">
<span>116</span> ++</a>
</div>
   / <span>List::MoreUtils</span>
</div>
          </div>
          <main class="content">


<nav class="toc">
  <div class="toc-header"><strong>Contents</strong></div>
<ul>
  <li><a href="./List::MoreUtils.html#NAME">NAME</a></li>
  <li><a href="./List::MoreUtils.html#SYNOPSIS">SYNOPSIS</a></li>
  <li><a href="./List::MoreUtils.html#DESCRIPTION">DESCRIPTION</a></li>
  <li><a href="./List::MoreUtils.html#EXPORTS">EXPORTS</a>
    <ul>
      <li><a href="./List::MoreUtils.html#Default-behavior">Default behavior</a></li>
      <li><a href="./List::MoreUtils.html#Like-version-0.22-(last-release-with-original-API)">Like version 0.22 (last release with original API)</a></li>
      <li><a href="./List::MoreUtils.html#Like-version-0.24-(first-incompatible-change)">Like version 0.24 (first incompatible change)</a></li>
      <li><a href="./List::MoreUtils.html#Like-version-0.33-(second-incompatible-change)">Like version 0.33 (second incompatible change)</a></li>
    </ul>
  </li>
  <li><a href="./List::MoreUtils.html#FUNCTIONS">FUNCTIONS</a>
    <ul>
      <li><a href="./List::MoreUtils.html#Junctions">Junctions</a>
        <ul>
          <li><a href="./List::MoreUtils.html#Treatment-of-an-empty-list">Treatment of an empty list</a></li>
          <li><a href="./List::MoreUtils.html#all-BLOCK-LIST">all BLOCK LIST</a></li>
          <li><a href="./List::MoreUtils.html#all_u-BLOCK-LIST">all_u BLOCK LIST</a></li>
          <li><a href="./List::MoreUtils.html#any-BLOCK-LIST">any BLOCK LIST</a></li>
          <li><a href="./List::MoreUtils.html#any_u-BLOCK-LIST">any_u BLOCK LIST</a></li>
          <li><a href="./List::MoreUtils.html#none-BLOCK-LIST">none BLOCK LIST</a></li>
          <li><a href="./List::MoreUtils.html#none_u-BLOCK-LIST">none_u BLOCK LIST</a></li>
          <li><a href="./List::MoreUtils.html#notall-BLOCK-LIST">notall BLOCK LIST</a></li>
          <li><a href="./List::MoreUtils.html#notall_u-BLOCK-LIST">notall_u BLOCK LIST</a></li>
          <li><a href="./List::MoreUtils.html#one-BLOCK-LIST">one BLOCK LIST</a></li>
          <li><a href="./List::MoreUtils.html#one_u-BLOCK-LIST">one_u BLOCK LIST</a></li>
        </ul>
      </li>
      <li><a href="./List::MoreUtils.html#Transformation">Transformation</a>
        <ul>
          <li><a href="./List::MoreUtils.html#apply-BLOCK-LIST">apply BLOCK LIST</a></li>
          <li><a href="./List::MoreUtils.html#insert_after-BLOCK-VALUE-LIST">insert_after BLOCK VALUE LIST</a></li>
          <li><a href="./List::MoreUtils.html#insert_after_string-STRING-VALUE-LIST">insert_after_string STRING VALUE LIST</a></li>
          <li><a href="./List::MoreUtils.html#pairwise-BLOCK-ARRAY1-ARRAY2">pairwise BLOCK ARRAY1 ARRAY2</a></li>
          <li><a href="./List::MoreUtils.html#mesh-ARRAY1-ARRAY2-%5B-ARRAY3-...-%5D">mesh ARRAY1 ARRAY2 [ ARRAY3 ... ]</a></li>
          <li><a href="./List::MoreUtils.html#zip-ARRAY1-ARRAY2-%5B-ARRAY3-...-%5D">zip ARRAY1 ARRAY2 [ ARRAY3 ... ]</a></li>
          <li><a href="./List::MoreUtils.html#zip6">zip6</a></li>
          <li><a href="./List::MoreUtils.html#zip_unflatten">zip_unflatten</a></li>
          <li><a href="./List::MoreUtils.html#listcmp-ARRAY0-ARRAY1-%5B-ARRAY2-...-%5D">listcmp ARRAY0 ARRAY1 [ ARRAY2 ... ]</a></li>
          <li><a href="./List::MoreUtils.html#arrayify-LIST%5B,LIST%5B,LIST...%5D%5D">arrayify LIST[,LIST[,LIST...]]</a></li>
          <li><a href="./List::MoreUtils.html#uniq-LIST">uniq LIST</a></li>
          <li><a href="./List::MoreUtils.html#distinct-LIST">distinct LIST</a></li>
          <li><a href="./List::MoreUtils.html#singleton-LIST">singleton LIST</a></li>
          <li><a href="./List::MoreUtils.html#duplicates-LIST">duplicates LIST</a></li>
          <li><a href="./List::MoreUtils.html#frequency-LIST">frequency LIST</a></li>
          <li><a href="./List::MoreUtils.html#occurrences-LIST">occurrences LIST</a></li>
          <li><a href="./List::MoreUtils.html#mode-LIST">mode LIST</a></li>
          <li><a href="./List::MoreUtils.html#slide-BLOCK-LIST">slide BLOCK LIST</a></li>
        </ul>
      </li>
      <li><a href="./List::MoreUtils.html#Partitioning">Partitioning</a>
        <ul>
          <li><a href="./List::MoreUtils.html#after-BLOCK-LIST">after BLOCK LIST</a></li>
          <li><a href="./List::MoreUtils.html#after_incl-BLOCK-LIST">after_incl BLOCK LIST</a></li>
          <li><a href="./List::MoreUtils.html#before-BLOCK-LIST">before BLOCK LIST</a></li>
          <li><a href="./List::MoreUtils.html#before_incl-BLOCK-LIST">before_incl BLOCK LIST</a></li>
          <li><a href="./List::MoreUtils.html#part-BLOCK-LIST">part BLOCK LIST</a></li>
          <li><a href="./List::MoreUtils.html#samples-COUNT-LIST">samples COUNT LIST</a></li>
        </ul>
      </li>
      <li><a href="./List::MoreUtils.html#Iteration">Iteration</a>
        <ul>
          <li><a href="./List::MoreUtils.html#each_array-ARRAY1-ARRAY2-...">each_array ARRAY1 ARRAY2 ...</a></li>
          <li><a href="./List::MoreUtils.html#each_arrayref-LIST">each_arrayref LIST</a></li>
          <li><a href="./List::MoreUtils.html#natatime-EXPR,-LIST">natatime EXPR, LIST</a></li>
          <li><a href="./List::MoreUtils.html#slideatatime-STEP,-WINDOW,-LIST">slideatatime STEP, WINDOW, LIST</a></li>
        </ul>
      </li>
      <li><a href="./List::MoreUtils.html#Searching">Searching</a>
        <ul>
          <li><a href="./List::MoreUtils.html#firstval-BLOCK-LIST">firstval BLOCK LIST</a></li>
          <li><a href="./List::MoreUtils.html#first_value-BLOCK-LIST">first_value BLOCK LIST</a></li>
          <li><a href="./List::MoreUtils.html#onlyval-BLOCK-LIST">onlyval BLOCK LIST</a></li>
          <li><a href="./List::MoreUtils.html#only_value-BLOCK-LIST">only_value BLOCK LIST</a></li>
          <li><a href="./List::MoreUtils.html#lastval-BLOCK-LIST">lastval BLOCK LIST</a></li>
          <li><a href="./List::MoreUtils.html#last_value-BLOCK-LIST">last_value BLOCK LIST</a></li>
          <li><a href="./List::MoreUtils.html#firstres-BLOCK-LIST">firstres BLOCK LIST</a></li>
          <li><a href="./List::MoreUtils.html#first_result-BLOCK-LIST">first_result BLOCK LIST</a></li>
          <li><a href="./List::MoreUtils.html#onlyres-BLOCK-LIST">onlyres BLOCK LIST</a></li>
          <li><a href="./List::MoreUtils.html#only_result-BLOCK-LIST">only_result BLOCK LIST</a></li>
          <li><a href="./List::MoreUtils.html#lastres-BLOCK-LIST">lastres BLOCK LIST</a></li>
          <li><a href="./List::MoreUtils.html#last_result-BLOCK-LIST">last_result BLOCK LIST</a></li>
          <li><a href="./List::MoreUtils.html#indexes-BLOCK-LIST">indexes BLOCK LIST</a></li>
          <li><a href="./List::MoreUtils.html#firstidx-BLOCK-LIST">firstidx BLOCK LIST</a></li>
          <li><a href="./List::MoreUtils.html#first_index-BLOCK-LIST">first_index BLOCK LIST</a></li>
          <li><a href="./List::MoreUtils.html#onlyidx-BLOCK-LIST">onlyidx BLOCK LIST</a></li>
          <li><a href="./List::MoreUtils.html#only_index-BLOCK-LIST">only_index BLOCK LIST</a></li>
          <li><a href="./List::MoreUtils.html#lastidx-BLOCK-LIST">lastidx BLOCK LIST</a></li>
          <li><a href="./List::MoreUtils.html#last_index-BLOCK-LIST">last_index BLOCK LIST</a></li>
        </ul>
      </li>
      <li><a href="./List::MoreUtils.html#Sorting">Sorting</a>
        <ul>
          <li><a href="./List::MoreUtils.html#sort_by-BLOCK-LIST">sort_by BLOCK LIST</a></li>
          <li><a href="./List::MoreUtils.html#nsort_by-BLOCK-LIST">nsort_by BLOCK LIST</a></li>
          <li><a href="./List::MoreUtils.html#qsort-BLOCK-ARRAY">qsort BLOCK ARRAY</a></li>
        </ul>
      </li>
      <li><a href="./List::MoreUtils.html#Searching-in-sorted-Lists">Searching in sorted Lists</a>
        <ul>
          <li><a href="./List::MoreUtils.html#bsearch-BLOCK-LIST">bsearch BLOCK LIST</a></li>
          <li><a href="./List::MoreUtils.html#bsearchidx-BLOCK-LIST">bsearchidx BLOCK LIST</a></li>
          <li><a href="./List::MoreUtils.html#bsearch_index-BLOCK-LIST">bsearch_index BLOCK LIST</a></li>
          <li><a href="./List::MoreUtils.html#lower_bound-BLOCK-LIST">lower_bound BLOCK LIST</a></li>
          <li><a href="./List::MoreUtils.html#upper_bound-BLOCK-LIST">upper_bound BLOCK LIST</a></li>
          <li><a href="./List::MoreUtils.html#equal_range-BLOCK-LIST">equal_range BLOCK LIST</a></li>
        </ul>
      </li>
      <li><a href="./List::MoreUtils.html#Operations-on-sorted-Lists">Operations on sorted Lists</a>
        <ul>
          <li><a href="./List::MoreUtils.html#binsert-BLOCK-ITEM-LIST">binsert BLOCK ITEM LIST</a></li>
          <li><a href="./List::MoreUtils.html#bsearch_insert-BLOCK-ITEM-LIST">bsearch_insert BLOCK ITEM LIST</a></li>
          <li><a href="./List::MoreUtils.html#bremove-BLOCK-LIST">bremove BLOCK LIST</a></li>
          <li><a href="./List::MoreUtils.html#bsearch_remove-BLOCK-LIST">bsearch_remove BLOCK LIST</a></li>
        </ul>
      </li>
      <li><a href="./List::MoreUtils.html#Counting-and-calculation">Counting and calculation</a>
        <ul>
          <li><a href="./List::MoreUtils.html#true-BLOCK-LIST">true BLOCK LIST</a></li>
          <li><a href="./List::MoreUtils.html#false-BLOCK-LIST">false BLOCK LIST</a></li>
          <li><a href="./List::MoreUtils.html#reduce_0-BLOCK-LIST">reduce_0 BLOCK LIST</a></li>
          <li><a href="./List::MoreUtils.html#reduce_1-BLOCK-LIST">reduce_1 BLOCK LIST</a></li>
          <li><a href="./List::MoreUtils.html#reduce_u-BLOCK-LIST">reduce_u BLOCK LIST</a></li>
          <li><a href="./List::MoreUtils.html#minmax-LIST">minmax LIST</a></li>
          <li><a href="./List::MoreUtils.html#minmaxstr-LIST">minmaxstr LIST</a></li>
        </ul>
      </li>
    </ul>
  </li>
  <li><a href="./List::MoreUtils.html#ENVIRONMENT">ENVIRONMENT</a></li>
  <li><a href="./List::MoreUtils.html#MAINTENANCE">MAINTENANCE</a></li>
  <li><a href="./List::MoreUtils.html#CONTRIBUTING">CONTRIBUTING</a></li>
  <li><a href="./List::MoreUtils.html#BUGS">BUGS</a></li>
  <li><a href="./List::MoreUtils.html#SUPPORT">SUPPORT</a>
    <ul>
      <li><a href="./List::MoreUtils.html#Where-can-I-go-for-help?">Where can I go for help?</a></li>
      <li><a href="./List::MoreUtils.html#Where-can-I-go-for-help-with-a-concrete-version?">Where can I go for help with a concrete version?</a></li>
      <li><a href="./List::MoreUtils.html#Business-support-and-maintenance">Business support and maintenance</a></li>
    </ul>
  </li>
  <li><a href="./List::MoreUtils.html#THANKS">THANKS</a>
    <ul>
      <li><a href="./List::MoreUtils.html#Tassilo-von-Parseval">Tassilo von Parseval</a></li>
      <li><a href="./List::MoreUtils.html#Jens-Rehsack">Jens Rehsack</a></li>
    </ul>
  </li>
  <li><a href="./List::MoreUtils.html#TODO">TODO</a></li>
  <li><a href="./List::MoreUtils.html#SEE-ALSO">SEE ALSO</a></li>
  <li><a href="./List::MoreUtils.html#AUTHOR">AUTHOR</a></li>
  <li><a href="./List::MoreUtils.html#COPYRIGHT-AND-LICENSE">COPYRIGHT AND LICENSE</a></li>
</ul></nav>
<div class="pod anchors">
<h1 id="NAME">NAME</h1>

<p>List::MoreUtils - Provide the stuff missing in List::Util</p>

<h1 id="SYNOPSIS">SYNOPSIS</h1>

<pre><code>    # import specific functions

    use List::MoreUtils qw(any uniq);

    if ( any { /foo/ } uniq @has_duplicates ) {
        # do stuff
    }

    # import everything

    use List::MoreUtils &#39;:all&#39;;

    # import by API

    # has &quot;original&quot; any/all/none/notall behavior
    use List::MoreUtils &#39;:like_0.22&#39;;
    # 0.22 + bsearch
    use List::MoreUtils &#39;:like_0.24&#39;;
    # has &quot;simplified&quot; any/all/none/notall behavior + (n)sort_by
    use List::MoreUtils &#39;:like_0.33&#39;;</code></pre>

<h1 id="DESCRIPTION">DESCRIPTION</h1>

<p><b>List::MoreUtils</b> provides some trivial but commonly needed functionality on lists which is not going to go into <a href="https://metacpan.org/pod/List::Util">List::Util</a>.</p>

<p>All of the below functions are implementable in only a couple of lines of Perl code. Using the functions from this module however should give slightly better performance as everything is implemented in C. The pure-Perl implementation of these functions only serves as a fallback in case the C portions of this module couldn&#39;t be compiled on this machine.</p>

<h1 id="EXPORTS">EXPORTS</h1>

<h2 id="Default-behavior"><a id="Default"></a>Default behavior</h2>

<p>Nothing by default. To import all of this module&#39;s symbols use the <code>:all</code> tag. Otherwise functions can be imported by name as usual:</p>

<pre><code>    use List::MoreUtils &#39;:all&#39;;

    use List::MoreUtils qw{ any firstidx };</code></pre>

<p>Because historical changes to the API might make upgrading List::MoreUtils difficult for some projects, the legacy API is available via special import tags.</p>

<h2 id="Like-version-0.22-(last-release-with-original-API)"><a id="Like"></a><a id="Like-version-0.22--last-release-with-original-API"></a>Like version 0.22 (last release with original API)</h2>

<p>This API was available from 2006 to 2009, returning undef for empty lists on <code>all</code>/<code>any</code>/<code>none</code>/<code>notall</code>:</p>

<pre><code>    use List::MoreUtils &#39;:like_0.22&#39;;</code></pre>

<p>This import tag will import all functions available as of version 0.22. However, it will import <code>any_u</code> as <code>any</code>, <code>all_u</code> as <code>all</code>, <code>none_u</code> as <code>none</code>, and <code>notall_u</code> as <code>notall</code>.</p>

<h2 id="Like-version-0.24-(first-incompatible-change)"><a id="Like1"></a><a id="Like-version-0.24--first-incompatible-change"></a>Like version 0.24 (first incompatible change)</h2>

<p>This API was available from 2010 to 2011. It changed the return value of <code>none</code> and added the <code>bsearch</code> function.</p>

<pre><code>    use List::MoreUtils &#39;:like_0.24&#39;;</code></pre>

<p>This import tag will import all functions available as of version 0.24. However it will import <code>any_u</code> as <code>any</code>, <code>all_u</code> as <code>all</code>, and <code>notall_u</code> as <code>notall</code>. It will import <code>none</code> as described in the documentation below (true for empty list).</p>

<h2 id="Like-version-0.33-(second-incompatible-change)"><a id="Like2"></a><a id="Like-version-0.33--second-incompatible-change"></a>Like version 0.33 (second incompatible change)</h2>

<p>This API was available from 2011 to 2014. It is widely used in several CPAN modules and thus it&#39;s closest to the current API. It changed the return values of <code>any</code>, <code>all</code>, and <code>notall</code>. It added the <code>sort_by</code> and <code>nsort_by</code> functions and the <code>distinct</code> alias for <code>uniq</code>. It omitted <code>bsearch</code>.</p>

<pre><code>    use List::MoreUtils &#39;:like_0.33&#39;;</code></pre>

<p>This import tag will import all functions available as of version 0.33. Note: it will not import <code>bsearch</code> for consistency with the 0.33 API.</p>

<h1 id="FUNCTIONS">FUNCTIONS</h1>

<h2 id="Junctions">Junctions</h2>

<h3 id="Treatment-of-an-empty-list"><a id="Treatment"></a><i>Treatment of an empty list</i></h3>

<p>There are two schools of thought for how to evaluate a junction on an empty list:</p>

<ul>

<li><p>Reduction to an identity (boolean)</p>

</li>
<li><p>Result is undefined (three-valued)</p>

</li>
</ul>

<p>In the first case, the result of the junction applied to the empty list is determined by a mathematical reduction to an identity depending on whether the underlying comparison is &quot;or&quot; or &quot;and&quot;. Conceptually:</p>

<pre><code>                    &quot;any are true&quot;      &quot;all are true&quot;
                    --------------      --------------
    2 elements:     A || B || 0         A &amp;&amp; B &amp;&amp; 1
    1 element:      A || 0              A &amp;&amp; 1
    0 elements:     0                   1</code></pre>

<p>In the second case, three-value logic is desired, in which a junction applied to an empty list returns <code>undef</code> rather than true or false</p>

<p>Junctions with a <code>_u</code> suffix implement three-valued logic. Those without are boolean.</p>

<h3 id="all-BLOCK-LIST"><a id="all"></a>all BLOCK LIST</h3>

<h3 id="all_u-BLOCK-LIST"><a id="all_u"></a>all_u BLOCK LIST</h3>

<p>Returns a true value if all items in LIST meet the criterion given through BLOCK. Sets <code>$_</code> for each item in LIST in turn:</p>

<pre><code>  print &quot;All values are non-negative&quot;
    if all { $_ &gt;= 0 } ($x, $y, $z);</code></pre>

<p>For an empty LIST, <code>all</code> returns true (i.e. no values failed the condition) and <code>all_u</code> returns <code>undef</code>.</p>

<p>Thus, <code>all_u(@list)</code> is equivalent to <code>@list ? all(@list) : undef</code>.</p>

<p><b>Note</b>: because Perl treats <code>undef</code> as false, you must check the return value of <code>all_u</code> with <code>defined</code> or you will get the opposite result of what you expect.</p>

<h3 id="any-BLOCK-LIST"><a id="any"></a>any BLOCK LIST</h3>

<h3 id="any_u-BLOCK-LIST"><a id="any_u"></a>any_u BLOCK LIST</h3>

<p>Returns a true value if any item in LIST meets the criterion given through BLOCK. Sets <code>$_</code> for each item in LIST in turn:</p>

<pre><code>  print &quot;At least one non-negative value&quot;
    if any { $_ &gt;= 0 } ($x, $y, $z);</code></pre>

<p>For an empty LIST, <code>any</code> returns false and <code>any_u</code> returns <code>undef</code>.</p>

<p>Thus, <code>any_u(@list)</code> is equivalent to <code>@list ? any(@list) : undef</code>.</p>

<h3 id="none-BLOCK-LIST"><a id="none"></a>none BLOCK LIST</h3>

<h3 id="none_u-BLOCK-LIST"><a id="none_u"></a>none_u BLOCK LIST</h3>

<p>Logically the negation of <code>any</code>. Returns a true value if no item in LIST meets the criterion given through BLOCK. Sets <code>$_</code> for each item in LIST in turn:</p>

<pre><code>  print &quot;No non-negative values&quot;
    if none { $_ &gt;= 0 } ($x, $y, $z);</code></pre>

<p>For an empty LIST, <code>none</code> returns true (i.e. no values failed the condition) and <code>none_u</code> returns <code>undef</code>.</p>

<p>Thus, <code>none_u(@list)</code> is equivalent to <code>@list ? none(@list) : undef</code>.</p>

<p><b>Note</b>: because Perl treats <code>undef</code> as false, you must check the return value of <code>none_u</code> with <code>defined</code> or you will get the opposite result of what you expect.</p>

<h3 id="notall-BLOCK-LIST"><a id="notall"></a>notall BLOCK LIST</h3>

<h3 id="notall_u-BLOCK-LIST"><a id="notall_u"></a>notall_u BLOCK LIST</h3>

<p>Logically the negation of <code>all</code>. Returns a true value if not all items in LIST meet the criterion given through BLOCK. Sets <code>$_</code> for each item in LIST in turn:</p>

<pre><code>  print &quot;Not all values are non-negative&quot;
    if notall { $_ &gt;= 0 } ($x, $y, $z);</code></pre>

<p>For an empty LIST, <code>notall</code> returns false and <code>notall_u</code> returns <code>undef</code>.</p>

<p>Thus, <code>notall_u(@list)</code> is equivalent to <code>@list ? notall(@list) : undef</code>.</p>

<h3 id="one-BLOCK-LIST"><a id="one"></a>one BLOCK LIST</h3>

<h3 id="one_u-BLOCK-LIST"><a id="one_u"></a>one_u BLOCK LIST</h3>

<p>Returns a true value if precisely one item in LIST meets the criterion given through BLOCK. Sets <code>$_</code> for each item in LIST in turn:</p>

<pre><code>    print &quot;Precisely one value defined&quot;
        if one { defined($_) } @list;</code></pre>

<p>Returns false otherwise.</p>

<p>For an empty LIST, <code>one</code> returns false and <code>one_u</code> returns <code>undef</code>.</p>

<p>The expression <code>one BLOCK LIST</code> is almost equivalent to <code>1 == true BLOCK LIST</code>, except for short-cutting. Evaluation of BLOCK will immediately stop at the second true value.</p>

<h2 id="Transformation">Transformation</h2>

<h3 id="apply-BLOCK-LIST"><a id="apply"></a>apply BLOCK LIST</h3>

<p>Applies BLOCK to each item in LIST and returns a list of the values after BLOCK has been applied. In scalar context, the last element is returned. This function is similar to <code>map</code> but will not modify the elements of the input list:</p>

<pre><code>  my @list = (1 .. 4);
  my @mult = apply { $_ *= 2 } @list;
  print &quot;\@list = @list\n&quot;;
  print &quot;\@mult = @mult\n&quot;;
  __END__
  @list = 1 2 3 4
  @mult = 2 4 6 8</code></pre>

<p>Think of it as syntactic sugar for</p>

<pre><code>  for (my @mult = @list) { $_ *= 2 }</code></pre>

<h3 id="insert_after-BLOCK-VALUE-LIST"><a id="insert_after"></a>insert_after BLOCK VALUE LIST</h3>

<p>Inserts VALUE after the first item in LIST for which the criterion in BLOCK is true. Sets <code>$_</code> for each item in LIST in turn.</p>

<pre><code>  my @list = qw/This is a list/;
  insert_after { $_ eq &quot;a&quot; } &quot;longer&quot; =&gt; @list;
  print &quot;@list&quot;;
  __END__
  This is a longer list</code></pre>

<h3 id="insert_after_string-STRING-VALUE-LIST"><a id="insert_after_string"></a>insert_after_string STRING VALUE LIST</h3>

<p>Inserts VALUE after the first item in LIST which is equal to STRING.</p>

<pre><code>  my @list = qw/This is a list/;
  insert_after_string &quot;a&quot;, &quot;longer&quot; =&gt; @list;
  print &quot;@list&quot;;
  __END__
  This is a longer list</code></pre>

<h3 id="pairwise-BLOCK-ARRAY1-ARRAY2"><a id="pairwise"></a>pairwise BLOCK ARRAY1 ARRAY2</h3>

<p>Evaluates BLOCK for each pair of elements in ARRAY1 and ARRAY2 and returns a new list consisting of BLOCK&#39;s return values. The two elements are set to <code>$a</code> and <code>$b</code>. Note that those two are aliases to the original value so changing them will modify the input arrays.</p>

<pre><code>  @a = (1 .. 5);
  @b = (11 .. 15);
  @x = pairwise { $a + $b } @a, @b;     # returns 12, 14, 16, 18, 20

  # mesh with pairwise
  @a = qw/a b c/;
  @b = qw/1 2 3/;
  @x = pairwise { ($a, $b) } @a, @b;    # returns a, 1, b, 2, c, 3</code></pre>

<h3 id="mesh-ARRAY1-ARRAY2-[-ARRAY3-...-]"><a id="mesh"></a><a id="mesh-ARRAY1-ARRAY2---ARRAY3"></a>mesh ARRAY1 ARRAY2 [ ARRAY3 ... ]</h3>

<h3 id="zip-ARRAY1-ARRAY2-[-ARRAY3-...-]"><a id="zip"></a><a id="zip-ARRAY1-ARRAY2---ARRAY3"></a>zip ARRAY1 ARRAY2 [ ARRAY3 ... ]</h3>

<p>Returns a list consisting of the first elements of each array, then the second, then the third, etc, until all arrays are exhausted.</p>

<p>Examples:</p>

<pre><code>  @x = qw/a b c d/;
  @y = qw/1 2 3 4/;
  @z = mesh @x, @y;         # returns a, 1, b, 2, c, 3, d, 4

  @a = (&#39;x&#39;);
  @b = (&#39;1&#39;, &#39;2&#39;);
  @c = qw/zip zap zot/;
  @d = mesh @a, @b, @c;   # x, 1, zip, undef, 2, zap, undef, undef, zot</code></pre>

<p><code>zip</code> is an alias for <code>mesh</code>.</p>

<h3 id="zip6">zip6</h3>

<h3 id="zip_unflatten">zip_unflatten</h3>

<p>Returns a list of arrays consisting of the first elements of each array, then the second, then the third, etc, until all arrays are exhausted.</p>

<pre><code>  @x = qw/a b c d/;
  @y = qw/1 2 3 4/;
  @z = zip6 @x, @y;         # returns [a, 1], [b, 2], [c, 3], [d, 4]

  @a = (&#39;x&#39;);
  @b = (&#39;1&#39;, &#39;2&#39;);
  @c = qw/zip zap zot/;
  @d = zip6 @a, @b, @c;     # [x, 1, zip], [undef, 2, zap], [undef, undef, zot]</code></pre>

<p><code>zip_unflatten</code> is an alias for <code>zip6</code>.</p>

<h3 id="listcmp-ARRAY0-ARRAY1-[-ARRAY2-...-]"><a id="listcmp"></a><a id="listcmp-ARRAY0-ARRAY1---ARRAY2"></a>listcmp ARRAY0 ARRAY1 [ ARRAY2 ... ]</h3>

<p>Returns an associative list of elements and every <i>id</i> of the list it was found in. Allows easy implementation of @a &amp; @b, @a | @b, @a ^ @b and so on. Undefined entries in any given array are skipped.</p>

<pre><code>  my @a = qw(one two three four five six seven eight nine ten eleven twelve thirteen);
  my @b = qw(two three five seven eleven thirteen seventeen);
  my @c = qw(one one two three five eight thirteen twentyone);
  my %cmp = listcmp @a, @b, @c; # returns (one =&gt; [0, 2], two =&gt; [0, 1, 2], three =&gt; [0, 1, 2], four =&gt; [0], ...)

  my @seq = (1, 2, 3);
  my @prim = (undef, 2, 3, 5);
  my @fib = (1, 1, 2);
  my %cmp = listcmp @seq, @prim, @fib;
  # returns ( 1 =&gt; [0, 2], 2 =&gt; [0, 1, 2], 3 =&gt; [0, 1], 5 =&gt; [1] )</code></pre>

<h3 id="arrayify-LIST[,LIST[,LIST...]]"><a id="arrayify"></a><a id="arrayify-LIST-LIST-LIST"></a>arrayify LIST[,LIST[,LIST...]]</h3>

<p>Returns a list consisting of each element of given arrays. Recursive arrays are flattened, too.</p>

<pre><code>  @a = (1, [[2], 3], 4, [5], 6, [7], 8, 9);
  @l = arrayify @a;         # returns 1, 2, 3, 4, 5, 6, 7, 8, 9</code></pre>

<h3 id="uniq-LIST"><a id="uniq"></a>uniq LIST</h3>

<h3 id="distinct-LIST"><a id="distinct"></a>distinct LIST</h3>

<p>Returns a new list by stripping duplicate values in LIST by comparing the values as hash keys, except that undef is considered separate from &#39;&#39;. The order of elements in the returned list is the same as in LIST. In scalar context, returns the number of unique elements in LIST.</p>

<pre><code>  my @x = uniq 1, 1, 2, 2, 3, 5, 3, 4; # returns 1 2 3 5 4
  my $x = uniq 1, 1, 2, 2, 3, 5, 3, 4; # returns 5
  # returns &quot;Mike&quot;, &quot;Michael&quot;, &quot;Richard&quot;, &quot;Rick&quot;
  my @n = distinct &quot;Mike&quot;, &quot;Michael&quot;, &quot;Richard&quot;, &quot;Rick&quot;, &quot;Michael&quot;, &quot;Rick&quot;
  # returns &quot;A8&quot;, &quot;&quot;, undef, &quot;A5&quot;, &quot;S1&quot;
  my @s = distinct &quot;A8&quot;, &quot;&quot;, undef, &quot;A5&quot;, &quot;S1&quot;, &quot;A5&quot;, &quot;A8&quot;
  # returns &quot;Giulia&quot;, &quot;Giulietta&quot;, undef, &quot;&quot;, 156, &quot;GTA&quot;, &quot;GTV&quot;, 159, &quot;Brera&quot;, &quot;4C&quot;
  my @w = uniq &quot;Giulia&quot;, &quot;Giulietta&quot;, undef, &quot;&quot;, 156, &quot;GTA&quot;, &quot;GTV&quot;, 159, &quot;Brera&quot;, &quot;4C&quot;, &quot;Giulietta&quot;, &quot;Giulia&quot;</code></pre>

<p><code>distinct</code> is an alias for <code>uniq</code>.</p>

<p><b>RT#49800</b> can be used to give feedback about this behavior.</p>

<h3 id="singleton-LIST"><a id="singleton"></a>singleton LIST</h3>

<p>Returns a new list by stripping values in LIST occurring more than once by comparing the values as hash keys, except that undef is considered separate from &#39;&#39;. The order of elements in the returned list is the same as in LIST. In scalar context, returns the number of elements occurring only once in LIST.</p>

<pre><code>  my @x = singleton 1,1,2,2,3,4,5 # returns 3 4 5</code></pre>

<h3 id="duplicates-LIST"><a id="duplicates"></a>duplicates LIST</h3>

<p>Returns a new list by stripping values in LIST occurring less than twice by comparing the values as hash keys, except that undef is considered separate from &#39;&#39;. The order of elements in the returned list is the same as in LIST. In scalar context, returns the number of elements occurring more than once in LIST.</p>

<pre><code>  my @y = duplicates 1,1,2,4,7,2,3,4,6,9; #returns 1,2,4</code></pre>

<h3 id="frequency-LIST"><a id="frequency"></a>frequency LIST</h3>

<p>Returns an associative list of distinct values and the corresponding frequency.</p>

<pre><code>  my @f = frequency values %radio_nrw; # returns (
  #  &#39;Deutschlandfunk (DLF)&#39; =&gt; 9, &#39;WDR 3&#39; =&gt; 10,
  #  &#39;WDR 4&#39; =&gt; 11, &#39;WDR 5&#39; =&gt; 14, &#39;WDR Eins Live&#39; =&gt; 14,
  #  &#39;Deutschlandradio Kultur&#39; =&gt; 8,...)</code></pre>

<h3 id="occurrences-LIST"><a id="occurrences"></a>occurrences LIST</h3>

<p>Returns a new list of frequencies and the corresponding values from LIST.</p>

<pre><code>  my @o = occurrences ((1) x 3, (2) x 4, (3) x 2, (4) x 7, (5) x 2, (6) x 4);
  #  @o = (undef, undef, [3, 5], [1], [2, 6], undef, undef, [4]);</code></pre>

<h3 id="mode-LIST"><a id="mode"></a>mode LIST</h3>

<p>Returns the modal value of LIST. In scalar context, just the modal value is returned, in list context all probes occurring <i>modal</i> times are returned, too.</p>

<pre><code>  my @m = mode ((1) x 3, (2) x 4, (3) x 2, (4) x 7, (5) x 2, (6) x 4, (7) x 3, (8) x 7);
  #  @m = (7, 4, 8) - bimodal LIST</code></pre>

<h3 id="slide-BLOCK-LIST"><a id="slide"></a>slide BLOCK LIST</h3>

<p>The function <code>slide</code> operates on pairs of list elements like:</p>

<pre><code>  my @s = slide { &quot;$a and $b&quot; } (0..3);
  # @s = (&quot;0 and 1&quot;, &quot;1 and 2&quot;, &quot;2 and 3&quot;)</code></pre>

<p>The idea behind this function is a kind of magnifying glass that is moved along a list and calls <code>BLOCK</code> every time the next list item is reached.</p>

<h2 id="Partitioning">Partitioning</h2>

<h3 id="after-BLOCK-LIST"><a id="after"></a>after BLOCK LIST</h3>

<p>Returns a list of the values of LIST after (and not including) the point where BLOCK returns a true value. Sets <code>$_</code> for each element in LIST in turn.</p>

<pre><code>  @x = after { $_ % 5 == 0 } (1..9);    # returns 6, 7, 8, 9</code></pre>

<h3 id="after_incl-BLOCK-LIST"><a id="after_incl"></a>after_incl BLOCK LIST</h3>

<p>Same as <code>after</code> but also includes the element for which BLOCK is true.</p>

<h3 id="before-BLOCK-LIST"><a id="before"></a>before BLOCK LIST</h3>

<p>Returns a list of values of LIST up to (and not including) the point where BLOCK returns a true value. Sets <code>$_</code> for each element in LIST in turn.</p>

<h3 id="before_incl-BLOCK-LIST"><a id="before_incl"></a>before_incl BLOCK LIST</h3>

<p>Same as <code>before</code> but also includes the element for which BLOCK is true.</p>

<h3 id="part-BLOCK-LIST"><a id="part"></a>part BLOCK LIST</h3>

<p>Partitions LIST based on the return value of BLOCK which denotes into which partition the current value is put.</p>

<p>Returns a list of the partitions thusly created. Each partition created is a reference to an array.</p>

<pre><code>  my $i = 0;
  my @part = part { $i++ % 2 } 1 .. 8;   # returns [1, 3, 5, 7], [2, 4, 6, 8]</code></pre>

<p>You can have a sparse list of partitions as well where non-set partitions will be undef:</p>

<pre><code>  my @part = part { 2 } 1 .. 10;            # returns undef, undef, [ 1 .. 10 ]</code></pre>

<p>Be careful with negative values, though:</p>

<pre><code>  my @part = part { -1 } 1 .. 10;
  __END__
  Modification of non-creatable array value attempted, subscript -1 ...</code></pre>

<p>Negative values are only ok when they refer to a partition previously created:</p>

<pre><code>  my @idx  = ( 0, 1, -1 );
  my $i    = 0;
  my @part = part { $idx[$i++ % 3] } 1 .. 8; # [1, 4, 7], [2, 3, 5, 6, 8]</code></pre>

<h3 id="samples-COUNT-LIST"><a id="samples"></a>samples COUNT LIST</h3>

<p>Returns a new list containing COUNT random samples from LIST. Is similar to <a href="https://metacpan.org/pod/List::Util#shuffle">&quot;shuffle&quot; in List::Util</a>, but stops after COUNT.</p>

<pre><code>  @r  = samples 10, 1..10; # same as shuffle
  @r2 = samples 5, 1..10; # gives 5 values from 1..10;</code></pre>

<h2 id="Iteration">Iteration</h2>

<h3 id="each_array-ARRAY1-ARRAY2-..."><a id="each_array"></a><a id="each_array-ARRAY1-ARRAY2"></a>each_array ARRAY1 ARRAY2 ...</h3>

<p>Creates an array iterator to return the elements of the list of arrays ARRAY1, ARRAY2 throughout ARRAYn in turn. That is, the first time it is called, it returns the first element of each array. The next time, it returns the second elements. And so on, until all elements are exhausted.</p>

<p>This is useful for looping over more than one array at once:</p>

<pre><code>  my $ea = each_array(@a, @b, @c);
  while ( my ($a, $b, $c) = $ea-&gt;() )   { .... }</code></pre>

<p>The iterator returns the empty list when it reached the end of all arrays.</p>

<p>If the iterator is passed an argument of &#39;<code>index</code>&#39;, then it returns the index of the last fetched set of values, as a scalar.</p>

<h3 id="each_arrayref-LIST"><a id="each_arrayref"></a>each_arrayref LIST</h3>

<p>Like each_array, but the arguments are references to arrays, not the plain arrays.</p>

<h3 id="natatime-EXPR,-LIST"><a id="natatime"></a><a id="natatime-EXPR--LIST"></a>natatime EXPR, LIST</h3>

<p>Creates an array iterator, for looping over an array in chunks of <code>$n</code> items at a time. (n at a time, get it?). An example is probably a better explanation than I could give in words.</p>

<p>Example:</p>

<pre><code>  my @x = (&#39;a&#39; .. &#39;g&#39;);
  my $it = natatime 3, @x;
  while (my @vals = $it-&gt;())
  {
    print &quot;@vals\n&quot;;
  }</code></pre>

<p>This prints</p>

<pre><code>  a b c
  d e f
  g</code></pre>

<h3 id="slideatatime-STEP,-WINDOW,-LIST"><a id="slideatatime"></a><a id="slideatatime-STEP--WINDOW--LIST"></a>slideatatime STEP, WINDOW, LIST</h3>

<p>Creates an array iterator, for looping over an array in chunks of <code>$windows-size</code> items at a time.</p>

<p>The idea behind this function is a kind of magnifying glass (finer controllable compared to <a href="./List::MoreUtils.html#slide">&quot;slide&quot;</a>) that is moved along a list.</p>

<p>Example:</p>

<pre><code>  my @x = (&#39;a&#39; .. &#39;g&#39;);
  my $it = slideatatime 2, 3, @x;
  while (my @vals = $it-&gt;())
  {
    print &quot;@vals\n&quot;;
  }</code></pre>

<p>This prints</p>

<pre><code>  a b c
  c d e
  e f g
  g</code></pre>

<h2 id="Searching">Searching</h2>

<h3 id="firstval-BLOCK-LIST"><a id="firstval"></a>firstval BLOCK LIST</h3>

<h3 id="first_value-BLOCK-LIST"><a id="first_value"></a>first_value BLOCK LIST</h3>

<p>Returns the first element in LIST for which BLOCK evaluates to true. Each element of LIST is set to <code>$_</code> in turn. Returns <code>undef</code> if no such element has been found.</p>

<p><code>first_value</code> is an alias for <code>firstval</code>.</p>

<h3 id="onlyval-BLOCK-LIST"><a id="onlyval"></a>onlyval BLOCK LIST</h3>

<h3 id="only_value-BLOCK-LIST"><a id="only_value"></a>only_value BLOCK LIST</h3>

<p>Returns the only element in LIST for which BLOCK evaluates to true. Sets <code>$_</code> for each item in LIST in turn. Returns <code>undef</code> if no such element has been found.</p>

<p><code>only_value</code> is an alias for <code>onlyval</code>.</p>

<h3 id="lastval-BLOCK-LIST"><a id="lastval"></a>lastval BLOCK LIST</h3>

<h3 id="last_value-BLOCK-LIST"><a id="last_value"></a>last_value BLOCK LIST</h3>

<p>Returns the last value in LIST for which BLOCK evaluates to true. Each element of LIST is set to <code>$_</code> in turn. Returns <code>undef</code> if no such element has been found.</p>

<p><code>last_value</code> is an alias for <code>lastval</code>.</p>

<h3 id="firstres-BLOCK-LIST"><a id="firstres"></a>firstres BLOCK LIST</h3>

<h3 id="first_result-BLOCK-LIST"><a id="first_result"></a>first_result BLOCK LIST</h3>

<p>Returns the result of BLOCK for the first element in LIST for which BLOCK evaluates to true. Each element of LIST is set to <code>$_</code> in turn. Returns <code>undef</code> if no such element has been found.</p>

<p><code>first_result</code> is an alias for <code>firstres</code>.</p>

<h3 id="onlyres-BLOCK-LIST"><a id="onlyres"></a>onlyres BLOCK LIST</h3>

<h3 id="only_result-BLOCK-LIST"><a id="only_result"></a>only_result BLOCK LIST</h3>

<p>Returns the result of BLOCK for the first element in LIST for which BLOCK evaluates to true. Sets <code>$_</code> for each item in LIST in turn. Returns <code>undef</code> if no such element has been found.</p>

<p><code>only_result</code> is an alias for <code>onlyres</code>.</p>

<h3 id="lastres-BLOCK-LIST"><a id="lastres"></a>lastres BLOCK LIST</h3>

<h3 id="last_result-BLOCK-LIST"><a id="last_result"></a>last_result BLOCK LIST</h3>

<p>Returns the result of BLOCK for the last element in LIST for which BLOCK evaluates to true. Each element of LIST is set to <code>$_</code> in turn. Returns <code>undef</code> if no such element has been found.</p>

<p><code>last_result</code> is an alias for <code>lastres</code>.</p>

<h3 id="indexes-BLOCK-LIST"><a id="indexes"></a>indexes BLOCK LIST</h3>

<p>Evaluates BLOCK for each element in LIST (assigned to <code>$_</code>) and returns a list of the indices of those elements for which BLOCK returned a true value. This is just like <code>grep</code> only that it returns indices instead of values:</p>

<pre><code>  @x = indexes { $_ % 2 == 0 } (1..10);   # returns 1, 3, 5, 7, 9</code></pre>

<h3 id="firstidx-BLOCK-LIST"><a id="firstidx"></a>firstidx BLOCK LIST</h3>

<h3 id="first_index-BLOCK-LIST"><a id="first_index"></a>first_index BLOCK LIST</h3>

<p>Returns the index of the first element in LIST for which the criterion in BLOCK is true. Sets <code>$_</code> for each item in LIST in turn:</p>

<pre><code>  my @list = (1, 4, 3, 2, 4, 6);
  printf &quot;item with index %i in list is 4&quot;, firstidx { $_ == 4 } @list;
  __END__
  item with index 1 in list is 4</code></pre>

<p>Returns <code>-1</code> if no such item could be found.</p>

<p><code>first_index</code> is an alias for <code>firstidx</code>.</p>

<h3 id="onlyidx-BLOCK-LIST"><a id="onlyidx"></a>onlyidx BLOCK LIST</h3>

<h3 id="only_index-BLOCK-LIST"><a id="only_index"></a>only_index BLOCK LIST</h3>

<p>Returns the index of the only element in LIST for which the criterion in BLOCK is true. Sets <code>$_</code> for each item in LIST in turn:</p>

<pre><code>    my @list = (1, 3, 4, 3, 2, 4);
    printf &quot;uniqe index of item 2 in list is %i&quot;, onlyidx { $_ == 2 } @list;
    __END__
    unique index of item 2 in list is 4</code></pre>

<p>Returns <code>-1</code> if either no such item or more than one of these has been found.</p>

<p><code>only_index</code> is an alias for <code>onlyidx</code>.</p>

<h3 id="lastidx-BLOCK-LIST"><a id="lastidx"></a>lastidx BLOCK LIST</h3>

<h3 id="last_index-BLOCK-LIST"><a id="last_index"></a>last_index BLOCK LIST</h3>

<p>Returns the index of the last element in LIST for which the criterion in BLOCK is true. Sets <code>$_</code> for each item in LIST in turn:</p>

<pre><code>  my @list = (1, 4, 3, 2, 4, 6);
  printf &quot;item with index %i in list is 4&quot;, lastidx { $_ == 4 } @list;
  __END__
  item with index 4 in list is 4</code></pre>

<p>Returns <code>-1</code> if no such item could be found.</p>

<p><code>last_index</code> is an alias for <code>lastidx</code>.</p>

<h2 id="Sorting">Sorting</h2>

<h3 id="sort_by-BLOCK-LIST"><a id="sort_by"></a>sort_by BLOCK LIST</h3>

<p>Returns the list of values sorted according to the string values returned by the KEYFUNC block or function. A typical use of this may be to sort objects according to the string value of some accessor, such as</p>

<pre><code>  sort_by { $_-&gt;name } @people</code></pre>

<p>The key function is called in scalar context, being passed each value in turn as both $_ and the only argument in the parameters, @_. The values are then sorted according to string comparisons on the values returned. This is equivalent to</p>

<pre><code>  sort { $a-&gt;name cmp $b-&gt;name } @people</code></pre>

<p>except that it guarantees the name accessor will be executed only once per value. One interesting use-case is to sort strings which may have numbers embedded in them &quot;naturally&quot;, rather than lexically.</p>

<pre><code>  sort_by { s/(\d+)/sprintf &quot;%09d&quot;, $1/eg; $_ } @strings</code></pre>

<p>This sorts strings by generating sort keys which zero-pad the embedded numbers to some level (9 digits in this case), helping to ensure the lexical sort puts them in the correct order.</p>

<h3 id="nsort_by-BLOCK-LIST"><a id="nsort_by"></a>nsort_by BLOCK LIST</h3>

<p>Similar to sort_by but compares its key values numerically.</p>

<h3 id="qsort-BLOCK-ARRAY"><a id="qsort"></a>qsort BLOCK ARRAY</h3>

<p>This sorts the given array <b>in place</b> using the given compare code. Except for tiny compare code like <code>$a &lt;=&gt; $b</code>, qsort is much faster than Perl&#39;s <code>sort</code> depending on the version.</p>

<p>Compared 5.8 and 5.26:</p>

<pre><code>  my @rl;
  for(my $i = 0; $i &lt; 1E6; ++$i) { push @rl, rand(1E5) }
  my $idx;

  sub ext_cmp { $_[0] &lt;=&gt; $_[1] }

  cmpthese( -60, {
      &#39;qsort&#39; =&gt; sub {
          my @qrl = @rl;
          qsort { ext_cmp($a, $b) } @qrl;
          $idx = bsearchidx { ext_cmp($_, $rl[0]) } @qrl
      },
      &#39;reverse qsort&#39; =&gt; sub {
          my @qrl = @rl;
          qsort { ext_cmp($b, $a) } @qrl;
          $idx = bsearchidx { ext_cmp($rl[0], $_) } @qrl
      },
      &#39;sort&#39; =&gt; sub {
          my @srl = @rl;
          @srl = sort { ext_cmp($a, $b) } @srl;
          $idx = bsearchidx { ext_cmp($_, $rl[0]) } @srl
      },
      &#39;reverse sort&#39; =&gt; sub {
          my @srl = @rl;
          @srl = sort { ext_cmp($b, $a) } @srl;
          $idx = bsearchidx { ext_cmp($rl[0], $_) } @srl
      },
  });</code></pre>

<p>5.8 results</p>

<pre><code>                  s/iter  reverse sort          sort reverse qsort         qsort
  reverse sort    6.21            --           -0%           -8%          -10%
  sort            6.19            0%            --           -7%          -10%
  reverse qsort   5.73            8%            8%            --           -2%
  qsort           5.60           11%           11%            2%            --</code></pre>

<p>5.26 results</p>

<pre><code>                s/iter  reverse sort          sort reverse qsort         qsort
  reverse sort    4.54            --           -0%          -96%          -96%
  sort            4.52            0%            --          -96%          -96%
  reverse qsort  0.203         2139%         2131%            --          -19%
  qsort          0.164         2666%         2656%           24%            --</code></pre>

<p>Use it where external data sources might have to be compared (think of <a href="https://metacpan.org/pod/Unix::Statgrab">Unix::Statgrab</a> &quot;tables&quot;).</p>

<p><code>qsort</code> is available from List::MoreUtils::XS only. It&#39;s insane to maintain a wrapper around Perl&#39;s sort nor having a pure Perl implementation. One could create a flip-book in same speed as PP runs a qsort.</p>

<h2 id="Searching-in-sorted-Lists"><a id="Searching1"></a>Searching in sorted Lists</h2>

<h3 id="bsearch-BLOCK-LIST"><a id="bsearch"></a>bsearch BLOCK LIST</h3>

<p>Performs a binary search on LIST which must be a sorted list of values. BLOCK must return a negative value if the current element (stored in <code>$_</code>) is smaller, a positive value if it is bigger and zero if it matches.</p>

<p>Returns a boolean value in scalar context. In list context, it returns the element if it was found, otherwise the empty list.</p>

<h3 id="bsearchidx-BLOCK-LIST"><a id="bsearchidx"></a>bsearchidx BLOCK LIST</h3>

<h3 id="bsearch_index-BLOCK-LIST"><a id="bsearch_index"></a>bsearch_index BLOCK LIST</h3>

<p>Performs a binary search on LIST which must be a sorted list of values. BLOCK must return a negative value if the current element (stored in <code>$_</code>) is smaller, a positive value if it is bigger and zero if it matches.</p>

<p>Returns the index of found element, otherwise <code>-1</code>.</p>

<p><code>bsearch_index</code> is an alias for <code>bsearchidx</code>.</p>

<h3 id="lower_bound-BLOCK-LIST"><a id="lower_bound"></a>lower_bound BLOCK LIST</h3>

<p>Returns the index of the first element in LIST which does not compare <i>less than val</i>. Technically it&#39;s the first element in LIST which does not return a value below zero when passed to BLOCK.</p>

<pre><code>  @ids = (1, 1, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 6, 7, 7, 7, 8, 8, 9, 9, 9, 9, 9, 11, 13, 13, 13, 17);
  $lb = lower_bound { $_ &lt;=&gt; 2 } @ids; # returns 2
  $lb = lower_bound { $_ &lt;=&gt; 4 } @ids; # returns 10</code></pre>

<p>lower_bound has a complexity of O(log n).</p>

<h3 id="upper_bound-BLOCK-LIST"><a id="upper_bound"></a>upper_bound BLOCK LIST</h3>

<p>Returns the index of the first element in LIST which does not compare <i>greater than val</i>. Technically it&#39;s the first element in LIST which does not return a value below or equal to zero when passed to BLOCK.</p>

<pre><code>  @ids = (1, 1, 2, 2, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 6, 7, 7, 7, 8, 8, 9, 9, 9, 9, 9, 11, 13, 13, 13, 17);
  $lb = upper_bound { $_ &lt;=&gt; 2 } @ids; # returns 4
  $lb = upper_bound { $_ &lt;=&gt; 4 } @ids; # returns 14</code></pre>

<p>upper_bound has a complexity of O(log n).</p>

<h3 id="equal_range-BLOCK-LIST"><a id="equal_range"></a>equal_range BLOCK LIST</h3>

<p>Returns a pair of indices containing the lower_bound and the upper_bound.</p>

<h2 id="Operations-on-sorted-Lists"><a id="Operations"></a>Operations on sorted Lists</h2>

<h3 id="binsert-BLOCK-ITEM-LIST"><a id="binsert"></a>binsert BLOCK ITEM LIST</h3>

<h3 id="bsearch_insert-BLOCK-ITEM-LIST"><a id="bsearch_insert"></a>bsearch_insert BLOCK ITEM LIST</h3>

<p>Performs a binary search on LIST which must be a sorted list of values. BLOCK must return a negative value if the current element (stored in <code>$_</code>) is smaller, a positive value if it is bigger and zero if it matches.</p>

<p>ITEM is inserted at the index where the ITEM should be placed (based on above search). That means, it&#39;s inserted before the next bigger element.</p>

<pre><code>  @l = (2,3,5,7);
  binsert { $_ &lt;=&gt; 4 }  4, @l; # @l = (2,3,4,5,7)
  binsert { $_ &lt;=&gt; 6 } 42, @l; # @l = (2,3,4,42,7)</code></pre>

<p>You take care that the inserted element matches the compare result.</p>

<h3 id="bremove-BLOCK-LIST"><a id="bremove"></a>bremove BLOCK LIST</h3>

<h3 id="bsearch_remove-BLOCK-LIST"><a id="bsearch_remove"></a>bsearch_remove BLOCK LIST</h3>

<p>Performs a binary search on LIST which must be a sorted list of values. BLOCK must return a negative value if the current element (stored in <code>$_</code>) is smaller, a positive value if it is bigger and zero if it matches.</p>

<p>The item at the found position is removed and returned.</p>

<pre><code>  @l = (2,3,4,5,7);
  bremove { $_ &lt;=&gt; 4 }, @l; # @l = (2,3,5,7);</code></pre>

<h2 id="Counting-and-calculation"><a id="Counting"></a>Counting and calculation</h2>

<h3 id="true-BLOCK-LIST"><a id="true"></a>true BLOCK LIST</h3>

<p>Counts the number of elements in LIST for which the criterion in BLOCK is true. Sets <code>$_</code> for each item in LIST in turn:</p>

<pre><code>  printf &quot;%i item(s) are defined&quot;, true { defined($_) } @list;</code></pre>

<h3 id="false-BLOCK-LIST"><a id="false"></a>false BLOCK LIST</h3>

<p>Counts the number of elements in LIST for which the criterion in BLOCK is false. Sets <code>$_</code> for each item in LIST in turn:</p>

<pre><code>  printf &quot;%i item(s) are not defined&quot;, false { defined($_) } @list;</code></pre>

<h3 id="reduce_0-BLOCK-LIST"><a id="reduce_0"></a>reduce_0 BLOCK LIST</h3>

<p>Reduce LIST by calling BLOCK in scalar context for each element of LIST. <code>$a</code> contains the progressional result and is initialized with 0. <code>$b</code> contains the current processed element of LIST and <code>$_</code> contains the index of the element in <code>$b</code>.</p>

<p>The idea behind reduce_0 is <b>summation</b> (addition of a sequence of numbers).</p>

<h3 id="reduce_1-BLOCK-LIST"><a id="reduce_1"></a>reduce_1 BLOCK LIST</h3>

<p>Reduce LIST by calling BLOCK in scalar context for each element of LIST. <code>$a</code> contains the progressional result and is initialized with 1. <code>$b</code> contains the current processed element of LIST and <code>$_</code> contains the index of the element in <code>$b</code>.</p>

<p>The idea behind reduce_1 is product of a sequence of numbers.</p>

<h3 id="reduce_u-BLOCK-LIST"><a id="reduce_u"></a>reduce_u BLOCK LIST</h3>

<p>Reduce LIST by calling BLOCK in scalar context for each element of LIST. <code>$a</code> contains the progressional result and is uninitialized. <code>$b</code> contains the current processed element of LIST and <code>$_</code> contains the index of the element in <code>$b</code>.</p>

<p>This function has been added if one might need the extra of the index value but need an individual initialization.</p>

<p><b>Use with caution</b>: In most cases <a href="https://metacpan.org/pod/List::Util#reduce">&quot;reduce&quot; in List::Util</a> will do the job better.</p>

<h3 id="minmax-LIST"><a id="minmax"></a>minmax LIST</h3>

<p>Calculates the minimum and maximum of LIST and returns a two element list with the first element being the minimum and the second the maximum. Returns the empty list if LIST was empty.</p>

<p>The <code>minmax</code> algorithm differs from a naive iteration over the list where each element is compared to two values being the so far calculated min and max value in that it only requires 3n/2 - 2 comparisons. Thus it is the most efficient possible algorithm.</p>

<p>However, the Perl implementation of it has some overhead simply due to the fact that there are more lines of Perl code involved. Therefore, LIST needs to be fairly big in order for <code>minmax</code> to win over a naive implementation. This limitation does not apply to the XS version.</p>

<h3 id="minmaxstr-LIST"><a id="minmaxstr"></a>minmaxstr LIST</h3>

<p>Computes the minimum and maximum of LIST using string compare and returns a two element list with the first element being the minimum and the second the maximum. Returns the empty list if LIST was empty.</p>

<p>The implementation is similar to <code>minmax</code>.</p>

<h1 id="ENVIRONMENT">ENVIRONMENT</h1>

<p>When <code>LIST_MOREUTILS_PP</code> is set, the module will always use the pure-Perl implementation and not the XS one. This environment variable is really just there for the test-suite to force testing the Perl implementation, and possibly for reporting of bugs. I don&#39;t see any reason to use it in a production environment.</p>

<h1 id="MAINTENANCE">MAINTENANCE</h1>

<p>The maintenance goal is to preserve the documented semantics of the API; bug fixes that bring actual behavior in line with semantics are allowed. New API functions may be added over time. If a backwards incompatible change is unavoidable, we will attempt to provide support for the legacy API using the same export tag mechanism currently in place.</p>

<p>This module attempts to use few non-core dependencies. Non-core configuration and testing modules will be bundled when reasonable; run-time dependencies will be added only if they deliver substantial benefit.</p>

<h1 id="CONTRIBUTING">CONTRIBUTING</h1>

<p>While contributions are appreciated, a contribution should not cause more effort for the maintainer than the contribution itself saves (see <a href="http://tirania.org/blog/archive/2010/Dec-31.html">Open Source Contribution Etiquette</a>).</p>

<p>To get more familiar where help could be needed - see <a href="https://metacpan.org/pod/distribution/List-MoreUtils/lib/List/MoreUtils/Contributing.pod">List::MoreUtils::Contributing</a>.</p>

<h1 id="BUGS">BUGS</h1>

<p>There is a problem with a bug in 5.6.x perls. It is a syntax error to write things like:</p>

<pre><code>    my @x = apply { s/foo/bar/ } qw{ foo bar baz };</code></pre>

<p>It has to be written as either</p>

<pre><code>    my @x = apply { s/foo/bar/ } &#39;foo&#39;, &#39;bar&#39;, &#39;baz&#39;;</code></pre>

<p>or</p>

<pre><code>    my @x = apply { s/foo/bar/ } my @dummy = qw/foo bar baz/;</code></pre>

<p>Perl 5.5.x and Perl 5.8.x don&#39;t suffer from this limitation.</p>

<p>If you have a functionality that you could imagine being in this module, please drop me a line. This module&#39;s policy will be less strict than <a href="https://metacpan.org/pod/List::Util">List::Util</a>&#39;s when it comes to additions as it isn&#39;t a core module.</p>

<p>When you report bugs, it would be nice if you could additionally give me the output of your program with the environment variable <code>LIST_MOREUTILS_PP</code> set to a true value. That way I know where to look for the problem (in XS, pure-Perl or possibly both).</p>

<h1 id="SUPPORT">SUPPORT</h1>

<p>Bugs should always be submitted via the CPAN bug tracker.</p>

<p>You can find documentation for this module with the perldoc command.</p>

<pre><code>    perldoc List::MoreUtils</code></pre>

<p>You can also look for information at:</p>

<ul>

<li><p>RT: CPAN&#39;s request tracker</p>

<p><a href="https://rt.cpan.org/Dist/Display.html?Name=List-MoreUtils">https://rt.cpan.org/Dist/Display.html?Name=List-MoreUtils</a></p>

</li>
<li><p>AnnoCPAN: Annotated CPAN documentation</p>

<p><a href="http://annocpan.org/dist/List-MoreUtils">http://annocpan.org/dist/List-MoreUtils</a></p>

</li>
<li><p>CPAN Ratings</p>

<p><a href="http://cpanratings.perl.org/dist/List-MoreUtils">http://cpanratings.perl.org/dist/List-MoreUtils</a></p>

</li>
<li><p>MetaCPAN</p>

<p><a href="https://metacpan.org/release/List-MoreUtils">https://metacpan.org/release/List-MoreUtils</a></p>

</li>
<li><p>CPAN Search</p>

<p><a href="http://search.cpan.org/dist/List-MoreUtils/">http://search.cpan.org/dist/List-MoreUtils/</a></p>

</li>
<li><p>Git Repository</p>

<p><a href="https://github.com/perl5-utils/List-MoreUtils">https://github.com/perl5-utils/List-MoreUtils</a></p>

</li>
</ul>

<h2 id="Where-can-I-go-for-help?"><a id="Where"></a><a id="Where-can-I-go-for-help"></a>Where can I go for help?</h2>

<p>If you have a bug report, a patch or a suggestion, please open a new report ticket at CPAN (but please check previous reports first in case your issue has already been addressed) or open an issue on GitHub.</p>

<p>Report tickets should contain a detailed description of the bug or enhancement request and at least an easily verifiable way of reproducing the issue or fix. Patches are always welcome, too - and it&#39;s cheap to send pull-requests on GitHub. Please keep in mind that code changes are more likely accepted when they&#39;re bundled with an approving test.</p>

<p>If you think you&#39;ve found a bug then please read &quot;How to Report Bugs Effectively&quot; by Simon Tatham: <a href="http://www.chiark.greenend.org.uk/~sgtatham/bugs.html">http://www.chiark.greenend.org.uk/~sgtatham/bugs.html</a>.</p>

<h2 id="Where-can-I-go-for-help-with-a-concrete-version?"><a id="Where1"></a><a id="Where-can-I-go-for-help-with-a-concrete-version"></a>Where can I go for help with a concrete version?</h2>

<p>Bugs and feature requests are accepted against the latest version only. To get patches for earlier versions, you need to get an agreement with a developer of your choice - who may or not report the issue and a suggested fix upstream (depends on the license you have chosen).</p>

<h2 id="Business-support-and-maintenance"><a id="Business"></a>Business support and maintenance</h2>

<p>Generally, in volunteered projects, there is no right for support. While every maintainer is happy to improve the provided software, spare time is limited.</p>

<p>For those who have a use case which requires guaranteed support, one of the maintainers should be hired or contracted. For business support you can contact Jens via his CPAN email address rehsackATcpan.org. Please keep in mind that business support is neither available for free nor are you eligible to receive any support based on the license distributed with this package.</p>

<h1 id="THANKS">THANKS</h1>

<h2 id="Tassilo-von-Parseval"><a id="Tassilo"></a>Tassilo von Parseval</h2>

<p>Credits go to a number of people: Steve Purkis for giving me namespace advice and James Keenan and Terrence Branno for their effort of keeping the CPAN tidier by making <a href="https://metacpan.org/pod/List::Utils">List::Utils</a> obsolete.</p>

<p>Brian McCauley suggested the inclusion of apply() and provided the pure-Perl implementation for it.</p>

<p>Eric J. Roode asked me to add all functions from his module <code>List::MoreUtil</code> into this one. With minor modifications, the pure-Perl implementations of those are by him.</p>

<p>The bunch of people who almost immediately pointed out the many problems with the glitchy 0.07 release (Slaven Rezic, Ron Savage, CPAN testers).</p>

<p>A particularly nasty memory leak was spotted by Thomas A. Lowery.</p>

<p>Lars Thegler made me aware of problems with older Perl versions.</p>

<p>Anno Siegel de-orphaned each_arrayref().</p>

<p>David Filmer made me aware of a problem in each_arrayref that could ultimately lead to a segfault.</p>

<p>Ricardo Signes suggested the inclusion of part() and provided the Perl-implementation.</p>

<p>Robin Huston kindly fixed a bug in perl&#39;s MULTICALL API to make the XS-implementation of part() work.</p>

<h2 id="Jens-Rehsack"><a id="Jens"></a>Jens Rehsack</h2>

<p>Credits goes to all people contributing feedback during the v0.400 development releases.</p>

<p>Special thanks goes to David Golden who spent a lot of effort to develop a design to support current state of CPAN as well as ancient software somewhere in the dark. He also contributed a lot of patches to refactor the API frontend to welcome any user of List::MoreUtils - from ancient past to recently last used.</p>

<p>Toby Inkster provided a lot of useful feedback for sane importer code and was a nice sounding board for API discussions.</p>

<p>Peter Rabbitson provided a sane git repository setup containing entire package history.</p>

<h1 id="TODO">TODO</h1>

<p>A pile of requests from other people is still pending further processing in my mailbox. This includes:</p>

<ul>

<li><p>delete_index</p>

</li>
<li><p>random_item</p>

</li>
<li><p>random_item_delete_index</p>

</li>
<li><p>list_diff_hash</p>

</li>
<li><p>list_diff_inboth</p>

</li>
<li><p>list_diff_infirst</p>

</li>
<li><p>list_diff_insecond</p>

<p>These were all suggested by Dan Muey.</p>

</li>
<li><p>listify</p>

<p>Always return a flat list when either a simple scalar value was passed or an array-reference. Suggested by Mark Summersault.</p>

</li>
</ul>

<h1 id="SEE-ALSO"><a id="SEE"></a>SEE ALSO</h1>

<p><a href="https://metacpan.org/pod/List::Util">List::Util</a>, <a href="https://metacpan.org/pod/List::AllUtils">List::AllUtils</a>, <a href="https://metacpan.org/pod/List::UtilsBy">List::UtilsBy</a></p>

<h1 id="AUTHOR">AUTHOR</h1>

<p>Jens Rehsack &lt;rehsack AT cpan.org&gt;</p>

<p>Adam Kennedy &lt;adamk@cpan.org&gt;</p>

<p>Tassilo von Parseval &lt;tassilo.von.parseval@rwth-aachen.de&gt;</p>

<h1 id="COPYRIGHT-AND-LICENSE"><a id="COPYRIGHT"></a>COPYRIGHT AND LICENSE</h1>

<p>Some parts copyright 2011 Aaron Crane.</p>

<p>Copyright 2004 - 2010 by Tassilo von Parseval</p>

<p>Copyright 2013 - 2017 by Jens Rehsack</p>

<p>All code added with 0.417 or later is licensed under the Apache License, Version 2.0 (the &quot;License&quot;); you may not use this file except in compliance with the License. You may obtain a copy of the License at</p>

<pre><code> http://www.apache.org/licenses/LICENSE-2.0</code></pre>

<p>Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an &quot;AS IS&quot; BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.</p>

<p>All code until 0.416 is licensed under the same terms as Perl itself, either Perl version 5.8.4 or, at your option, any later version of Perl 5 you may have available.</p></div>

<div id="metacpan_install-instructions-dialog" class="modal fade">
  <div class="modal-dialog">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
        <h4 class="modal-title">Module Install Instructions</h4>
      </div>
      <div class="modal-body">
        <p>To install List::MoreUtils, copy and paste the appropriate command in to your terminal.</p>
        <p><a href="https://metacpan.org/dist/App-cpanminus/view/bin/cpanm">cpanm</a></p>
        <pre><code>cpanm List::MoreUtils</code></pre>
        <p><a href="https://metacpan.org/pod/CPAN">CPAN shell</a></p>
        <pre><code>perl -MCPAN -e shell
install List::MoreUtils</code></pre>
        <p>For more information on module installation, please visit <a href="https://www.cpan.org/modules/INSTALL.html">the detailed CPAN module installation guide</a>.</p>
      </div>
      <div class="modal-footer">
        <a href="./List::MoreUtils.html#" data-dismiss="modal" class="btn">Close</a>
      </div>
    </div>
  </div>
</div>
          </main>
          <div class="content-pagination">
          </div>
        </div>
        <footer class="footer">
          <div class="footer-container">
            <div class="footer-social">
              <div class="footer-link footer-logo">
                <a href="https://metacpan.org/">
                  <img src="https://metacpan.org/static/images/metacpan-logo.svg" alt="MetaCPAN" />
                </a>
              </div>
              <a class="footer-social-link" href="https://github.com/metacpan">
                <i class="fab fa-github-square"></i>
              </a>
              <a class="footer-social-link" href="https://fosstodon.org/@metacpan">
                <i class="fab fa-mastodon"></i>
              </a>
            </div>
            <div class="footer-links">
              <div class="footer-link">
                  <a href="https://metacpan.org/about">About</a>
              </div>
              <div class="footer-link">
                  <a href="https://metacpan.org/about/sponsors">Sponsor</a>
              </div>
              <div class="footer-link">
                  <a href="https://grep.metacpan.org">grep::cpan</a>
              </div>
              <div class="footer-link">
                  <a href="https://metacpan.org/recent">Recent</a>
              </div>
              <div class="footer-link">
                  <a href="https://metacpan.org/about/faq">FAQ</a>
              </div>
              <div class="footer-link">
                  <a href="https://metacpan.org/tools">Tools</a>
              </div>
              <div class="footer-link">
                  <a href="https://fastapi.metacpan.org/">API</a>
              </div>
              <div class="footer-link">
                  <a href="https://www.perl.org/">Perl.org</a>
              </div>
            </div>
            <div class="footer-sponsors">
              <a class="footer-sponsor-link" target="_blank" href="https://www.bytemark.co.uk/" rel="noopener">
                <img class="footer-sponsor-bytemark" src="https://metacpan.org/static/images/sponsors/bytemark_logo.svg" alt="Bytemark logo">
              </a>
              <a class="footer-sponsor-link" target="_blank" href="https://www.liquidweb.com/" rel="noopener">
                <img class="footer-sponsor-liquidweb" src="https://metacpan.org/static/images/sponsors/liquidweb_logo.png" alt="liquidweb logo">
              </a>
              <a class="footer-sponsor-link" target="_blank" href="https://deriv.com/careers/" rel="noopener">
                <img class="footer-sponsor-deriv" src="https://metacpan.org/static/images/sponsors/deriv.svg" alt="Deriv logo">
              </a>
              <a class="footer-sponsor-link" target="_blank" href="https://geocode.xyz" rel="noopener">
                <img class="footer-sponsor-geocode" src="https://metacpan.org/static/images/sponsors/geocodelogo.svg" alt="Geocode logo">
              </a>
              <a class="footer-sponsor-link" target="_blank" href="https://www.fastly.com/" rel="noopener">
                <img class="footer-sponsor-fastly" src="https://metacpan.org/static/images/sponsors/fastly_logo.svg" alt="Fastly logo">
              </a>
              <a class="footer-sponsor-link" target="_blank" href="https://opencagedata.com" rel="noopener">
                <img class="footer-sponsor-opencage" src="https://metacpan.org/static/images/sponsors/open-cage.svg" alt="OpenCage logo">
              </a>
            </div>
          </div>
        </footer>
        <div class="modal fade" tabindex="-1" role="dialog" id="metacpan_keyboard-shortcuts">
          <div class="modal-dialog">
            <div class="modal-content">
              <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal">&times;</button>
                <h4 class="modal-title">Keyboard Shortcuts</h4>
              </div>
              <div class="modal-body row">
<div class="col-md-6">
  <table class="table keyboard-shortcuts">
    <thead>
      <tr>
        <th></th>
        <th>Global</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td class="keys">
          <kbd>s</kbd>
        </td>
        <td>Focus search bar</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>?</kbd>
        </td>
        <td>Bring up this help dialog</td>
      </tr>
    </tbody>
  </table>

  <table class="table keyboard-shortcuts">
    <thead>
      <tr>
        <th></th>
        <th>GitHub</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>p</kbd>
        </td>
        <td>Go to pull requests</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>i</kbd>
        </td>
        <td>go to github issues (only if github is preferred repository)</td>
      </tr>
    </tbody>
  </table>
</div>

<div class="col-md-6">
  <table class="table keyboard-shortcuts">
    <thead>
      <tr>
        <th></th>
        <th>POD</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>a</kbd>
        </td>
        <td>Go to author</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>c</kbd>
        </td>
        <td>Go to changes</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>i</kbd>
        </td>
        <td>Go to issues</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>d</kbd>
        </td>
        <td>Go to dist</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>r</kbd>
        </td>
        <td>Go to repository/SCM</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>s</kbd>
        </td>
        <td>Go to source</td>
      </tr>
      <tr>
        <td class="keys">
          <kbd>g</kbd> <kbd>b</kbd>
        </td>
        <td>Go to file browse</td>
      </tr>

    </tbody>
  </table>
</div>

<div class="col-md-12">
  <table class="table keyboard-shortcuts">
    <thead>
      <tr>
        <th></th>
        <th>Search terms</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td><em>module:</em> (e.g. <a href="https://metacpan.org/search?q=module%3APlugin">module:Plugin</a>)</td>
      </tr>
      <tr>
        <td><em>distribution:</em> (e.g. <a href="https://metacpan.org/search?q=distribution%3ADancer+auth">distribution:Dancer auth</a>)</td>
      </tr>
      <tr>
        <td><em>author:</em> (e.g. <a href="https://metacpan.org/search?q=author%3ASONGMU+Redis">author:SONGMU Redis</a>)</td>
      </tr>
      <tr>
        <td><em>version:</em> (e.g. <a href="https://metacpan.org/search?q=version%3A1.00">version:1.00</a>)</td>
      </tr>
    </tbody>
  </table>
</div>
              </div>
              <div class="modal-footer"></div>
            </div>
          </div>
        </div>
    </body>
</html>
